<html>
<head><meta charset="utf-8"><title>initialization · t-compiler/wg-polonius · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/index.html">t-compiler/wg-polonius</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html">initialization</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="170875528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170875528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170875528">(Jul 15 2019 at 09:05)</a>:</h4>
<p>Hi <span class="user-group-mention" data-user-group-id="1184">@WG-polonius</span>! By now Niko should be on vacation (DON'T READ NIKO, VACATE!),  but I figured I should give working on initialisation a shot anyway. I have a rough idea of what I should do, and some questions, including one on error reporting that <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/illegal.20subset.20relations.20polonius.2399/near/161234884" title="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/illegal.20subset.20relations.20polonius.2399/near/161234884">overlaps</a> with @lqd's work on illegal subset relations.</p>
<p>Would anyone be willing to have a quick chat about this at some point? It makes more sense to me to see if anyone has answers to my questions before I start digging the answers out of Rust and/or make assumptions.</p>



<a name="170878397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170878397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170878397">(Jul 15 2019 at 09:51)</a>:</h4>
<p>with Niko and Felix gone, maybe Matthew would be a good person to talk to</p>



<a name="170878463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170878463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170878463">(Jul 15 2019 at 09:52)</a>:</h4>
<p>or ofc eddyb</p>



<a name="170880018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170880018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170880018">(Jul 15 2019 at 10:18)</a>:</h4>
<p>Hmh, yes probably</p>



<a name="170880033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170880033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170880033">(Jul 15 2019 at 10:18)</a>:</h4>
<p>Thanks</p>



<a name="170881374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170881374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170881374">(Jul 15 2019 at 10:39)</a>:</h4>
<p>Ping <span class="user-mention" data-user-id="116118">@Matthew Jasper</span> to begin with, would you have the time to talk a bit about initialisation at some point?</p>



<a name="170884026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170884026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170884026">(Jul 15 2019 at 11:27)</a>:</h4>
<p>I should be free and at my computer in 7-8 hours. I could answer any really simple questions now.</p>



<a name="170884516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170884516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170884516">(Jul 15 2019 at 11:35)</a>:</h4>
<p>/me does not read</p>



<a name="170886836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170886836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170886836">(Jul 15 2019 at 12:16)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> thanks! Poke me when you're available, or preferably slightly before that so I can get to a computer :)</p>



<a name="170908055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170908055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robert Jacobson <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170908055">(Jul 15 2019 at 16:17)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> I haven't forgotten your generous offer to read what I write about Polonius, but I got sidetracked by writing a Pratt parser/Pratt parser generator in Rust, a creature that seems to be conspicuously absent from the Rust ecosystem. Just curious, have there been discussions about strengthening the Rust parser ecosystem? Or is it considered not particularly important considering the existence of other well-known external tools like Ragel that already target Rust? I haven't worked in this space long enough to know.</p>



<a name="170911495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170911495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170911495">(Jul 15 2019 at 17:00)</a>:</h4>
<p><span class="user-mention" data-user-id="226268">@Robert Jacobson</span> I don't know, honestly, I'm rather new here myself.</p>



<a name="170912849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170912849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170912849">(Jul 15 2019 at 17:18)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> I should be able to discuss things in 20-30 minutes</p>



<a name="170914716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170914716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170914716">(Jul 15 2019 at 17:37)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> Yay!</p>



<a name="170915811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170915811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170915811">(Jul 15 2019 at 17:52)</a>:</h4>
<p>Ok, I'm here</p>



<a name="170915898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170915898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170915898">(Jul 15 2019 at 17:53)</a>:</h4>
<p>So, there were some notes on this here: <a href="https://paper.dropbox.com/doc/Polonius-and-initialization--Ag9uxQB9rVuyu~JQ71KkYscwAg-mNvR4jqITCdsJDUMEhFbv" target="_blank" title="https://paper.dropbox.com/doc/Polonius-and-initialization--Ag9uxQB9rVuyu~JQ71KkYscwAg-mNvR4jqITCdsJDUMEhFbv">https://paper.dropbox.com/doc/Polonius-and-initialization--Ag9uxQB9rVuyu~JQ71KkYscwAg-mNvR4jqITCdsJDUMEhFbv</a></p>



<a name="170916330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170916330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170916330">(Jul 15 2019 at 17:58)</a>:</h4>
<p>...which I don't have write access to</p>



<a name="170916687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170916687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170916687">(Jul 15 2019 at 18:02)</a>:</h4>
<p>But the last section provides some details on what to do.</p>



<a name="170916707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170916707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170916707">(Jul 15 2019 at 18:02)</a>:</h4>
<p>If you have an email for me (feel free to PM) I can invite you</p>



<a name="170916747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170916747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170916747">(Jul 15 2019 at 18:03)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> Yes, I had a look at them earlier</p>



<a name="170916917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170916917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170916917">(Jul 15 2019 at 18:05)</a>:</h4>
<p>I think I understand the big picture: so I want to produce the following facts:<br>
- "path x1 is a child of path x2"<br>
- "path x was accessed at point p" facts<br>
- "path x was initialised at point p" facts<br>
- "path x was deinitialised at point p"</p>



<a name="170917029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917029">(Jul 15 2019 at 18:06)</a>:</h4>
<p>I think it would be fairly straightforward to use that to calculate which paths are inintialised maybe/for sure where, and then from that to errors on invalid access</p>



<a name="170917085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917085">(Jul 15 2019 at 18:07)</a>:</h4>
<p>However, I think I should start by calculating <code>var_initialized_on_exit(V, P)</code> because I already have those tuples collected</p>



<a name="170917098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917098">(Jul 15 2019 at 18:07)</a>:</h4>
<p>It should be true if the variable V might be initialised at P</p>



<a name="170917110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917110">(Jul 15 2019 at 18:07)</a>:</h4>
<p>So step 1 is to implement <code>Atom</code> for <code>MovePathIndex</code> (the one defined here: <a href="https://github.com/rust-lang/rust/blob/f3f9d6dfd92dfaeb14df891ad27b2531809dd734/src/librustc_mir/dataflow/move_paths/mod.rs#L16" target="_blank" title="https://github.com/rust-lang/rust/blob/f3f9d6dfd92dfaeb14df891ad27b2531809dd734/src/librustc_mir/dataflow/move_paths/mod.rs#L16">https://github.com/rust-lang/rust/blob/f3f9d6dfd92dfaeb14df891ad27b2531809dd734/src/librustc_mir/dataflow/move_paths/mod.rs#L16</a>)</p>



<a name="170917124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917124">(Jul 15 2019 at 18:07)</a>:</h4>
<p>Ok, that was another question I had, what I should use for the input</p>



<a name="170917136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917136">(Jul 15 2019 at 18:08)</a>:</h4>
<p>But that was my best candidate :)</p>



<a name="170917193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917193">(Jul 15 2019 at 18:08)</a>:</h4>
<blockquote>
<p>However, I think I should start by calculating <code>var_initialized_on_exit(V, P)</code> because I already have those tuples collected</p>
</blockquote>
<p>That sounds more sensible than trying to implement the remaining half of the borrow checker</p>



<a name="170917215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917215">(Jul 15 2019 at 18:08)</a>:</h4>
<p>Arr, How Hard Could It Be™</p>



<a name="170917228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917228">(Jul 15 2019 at 18:08)</a>:</h4>
<p>Very hard with the time you have.</p>



<a name="170917235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917235">(Jul 15 2019 at 18:09)</a>:</h4>
<p>True</p>



<a name="170917250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917250">(Jul 15 2019 at 18:09)</a>:</h4>
<p>Most of the facts can be extracted from this struct <a href="https://github.com/rust-lang/rust/blob/f3f9d6dfd92dfaeb14df891ad27b2531809dd734/src/librustc_mir/dataflow/move_paths/mod.rs#L99" target="_blank" title="https://github.com/rust-lang/rust/blob/f3f9d6dfd92dfaeb14df891ad27b2531809dd734/src/librustc_mir/dataflow/move_paths/mod.rs#L99">https://github.com/rust-lang/rust/blob/f3f9d6dfd92dfaeb14df891ad27b2531809dd734/src/librustc_mir/dataflow/move_paths/mod.rs#L99</a></p>



<a name="170917266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917266">(Jul 15 2019 at 18:09)</a>:</h4>
<p>Isn't that sort of cheating?</p>



<a name="170917277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917277">(Jul 15 2019 at 18:09)</a>:</h4>
<p>Because that struct already kind of has all the initialisation data, right?</p>



<a name="170917377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917377">(Jul 15 2019 at 18:10)</a>:</h4>
<p>It only has where things are initialized and deinitialized, not the initialization flow data.</p>



<a name="170917405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917405">(Jul 15 2019 at 18:11)</a>:</h4>
<p>Oh, ok, then it makes sense</p>



<a name="170917429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917429">(Jul 15 2019 at 18:11)</a>:</h4>
<p>Ok, and that one obviously has the mapping from local &lt;-&gt; move paths</p>



<a name="170917448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917448">(Jul 15 2019 at 18:11)</a>:</h4>
<p>So that was...all my questions I think</p>



<a name="170917463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917463">(Jul 15 2019 at 18:11)</a>:</h4>
<p><code>rev_lookup</code> contains the relations between move paths and locals, and the parent relation.</p>



<a name="170917551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917551">(Jul 15 2019 at 18:12)</a>:</h4>
<p>and <code>moves</code> and <code>inits</code>contain the initializations and deinitializations</p>



<a name="170917557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917557">(Jul 15 2019 at 18:12)</a>:</h4>
<p>Yes, I'm already using it to get var_initialized_on_exit (which should probably be renamed to var_may_be_initialized_on_exit)</p>



<a name="170917590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917590">(Jul 15 2019 at 18:13)</a>:</h4>
<p>Which leaves the "used at" facts, which you fortunately don't need for <code>var_may_be_initialized_on_exit</code></p>



<a name="170917599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917599">(Jul 15 2019 at 18:13)</a>:</h4>
<p>no, and I already have them right?</p>



<a name="170917609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917609">(Jul 15 2019 at 18:13)</a>:</h4>
<p>I needed them for liveness</p>



<a name="170917677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917677">(Jul 15 2019 at 18:14)</a>:</h4>
<p>Unless I need a used at for a move path and not a variable hmm</p>



<a name="170917686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917686">(Jul 15 2019 at 18:14)</a>:</h4>
<p>Yes</p>



<a name="170917705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917705">(Jul 15 2019 at 18:14)</a>:</h4>
<p>So liveness considers <code>x.a</code> a use of <code>x</code>, but for move errors it's only a use of <code>x.a</code></p>



<a name="170917721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917721">(Jul 15 2019 at 18:15)</a>:</h4>
<p>ah of course</p>



<a name="170917728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917728">(Jul 15 2019 at 18:15)</a>:</h4>
<p>so it's higher resolution</p>



<a name="170917873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917873">(Jul 15 2019 at 18:16)</a>:</h4>
<p>Actually, they shouldn't be too bad to generate</p>



<a name="170917936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170917936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170917936">(Jul 15 2019 at 18:17)</a>:</h4>
<p>You can add a <code>visit_place</code> method to the implementation here: <a href="https://github.com/rust-lang/rust/blob/099f9e4e8aac3968888636e2126c4b7f8e6bb2d3/src/librustc_mir/borrow_check/nll/invalidation.rs#L57" target="_blank" title="https://github.com/rust-lang/rust/blob/099f9e4e8aac3968888636e2126c4b7f8e6bb2d3/src/librustc_mir/borrow_check/nll/invalidation.rs#L57">https://github.com/rust-lang/rust/blob/099f9e4e8aac3968888636e2126c4b7f8e6bb2d3/src/librustc_mir/borrow_check/nll/invalidation.rs#L57</a></p>



<a name="170918170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918170">(Jul 15 2019 at 18:19)</a>:</h4>
<p>Then you generate a uses fact if the context is a non-mutating use, or it's a <code>MutatingUse(Borrow)</code>.</p>



<a name="170918239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918239">(Jul 15 2019 at 18:20)</a>:</h4>
<p>Hm, ok, and how do I go from there to the MovePathIndex of the use?</p>



<a name="170918341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918341">(Jul 15 2019 at 18:22)</a>:</h4>
<p><code>move_data.rev_lookup.find()</code>, and then extract the move path from the returned value.</p>



<a name="170918393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918393">(Jul 15 2019 at 18:22)</a>:</h4>
<p>Ah, ok so I have that in the context</p>



<a name="170918401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918401">(Jul 15 2019 at 18:22)</a>:</h4>
<p>You can add it.</p>



<a name="170918455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918455">(Jul 15 2019 at 18:23)</a>:</h4>
<p>Ok, that makes sense</p>



<a name="170918479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918479">(Jul 15 2019 at 18:23)</a>:</h4>
<p>That's not quite correct for <code>Box</code> de-references and inline asm. But it should be a close approximation.</p>



<a name="170918490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918490">(Jul 15 2019 at 18:23)</a>:</h4>
<p>and it can be fixed.</p>



<a name="170918563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918563">(Jul 15 2019 at 18:24)</a>:</h4>
<p>Ah, ok</p>



<a name="170918569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918569">(Jul 15 2019 at 18:24)</a>:</h4>
<p>and assigning to any dereference....</p>



<a name="170918594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918594">(Jul 15 2019 at 18:24)</a>:</h4>
<p>Haha</p>



<a name="170918611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918611">(Jul 15 2019 at 18:24)</a>:</h4>
<p>What I have learned from this project is that it's a miracle that any compiler ever works for anything</p>



<a name="170918637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918637">(Jul 15 2019 at 18:25)</a>:</h4>
<p>So true</p>



<a name="170918682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918682">(Jul 15 2019 at 18:25)</a>:</h4>
<p>I currently have a sheet of paper containing a very messy mind-map of which module calls which function where to populate data for which other function, and that's just to have an idea for where Polonius intersects with NLL</p>



<a name="170918784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918784">(Jul 15 2019 at 18:26)</a>:</h4>
<p>Ok, but I think that's more than enough to get me started. Do you also have a suggestion for where to intercept <code>MoveData</code> and start emitting facts?</p>



<a name="170918931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170918931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170918931">(Jul 15 2019 at 18:28)</a>:</h4>
<p>Do you think <code>liveness::generate()</code> would do, or should it be earlier?</p>



<a name="170919273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170919273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170919273">(Jul 15 2019 at 18:32)</a>:</h4>
<p>I'd probably do it right when we create the <code>AllFacts</code></p>



<a name="170919296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170919296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170919296">(Jul 15 2019 at 18:33)</a>:</h4>
<p>In the totally accurately named nll/mod.rs:compute_regions</p>



<a name="170919307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170919307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170919307">(Jul 15 2019 at 18:33)</a>:</h4>
<p>I did wonder about that one</p>



<a name="170919382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170919382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170919382">(Jul 15 2019 at 18:34)</a>:</h4>
<p>But that sounds good</p>



<a name="170919386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/170919386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#170919386">(Jul 15 2019 at 18:34)</a>:</h4>
<p>Thank you so much!</p>



<a name="171606968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171606968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171606968">(Jul 24 2019 at 13:45)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> I ran into a snag of sorts; I'm not sure I understand how MIR <code>Local</code>s translate to their corresponding <code>MovePathIndex</code>es. So what I did was I populated the <code>var_starts_path</code> fact from basically dumping the lookups in <code>MovePathLookup</code> so that I have tuples of <code>(Local, MovePathIndex)</code>. In my small sample program, this generates one <code>MovePathIndex</code>per <code>Local</code>, basically, which is weird because many of them map to the same place. Basically, I don't know where to look for the information that somehow shows that a case like <code>_1 = _2</code> means <code>_1</code> now is the "same" as <code>_2</code>, for some definition of sameness.</p>



<a name="171607157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171607157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171607157">(Jul 24 2019 at 13:47)</a>:</h4>
<p>Or, I guess what is weird is that when I try to populate my <code>parent</code>relation by iterating over all the <code>MovePaths</code> in <code>MoveData</code> and adding a tuple per entry I get from <code>move_path.parents()</code>, I only get one interesting parent relationship and nothing matching the move paths where things are actually moved out of my tuple</p>



<a name="171607335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171607335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171607335">(Jul 24 2019 at 13:49)</a>:</h4>
<p>Specifically, my code looks like this:</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">populate_polonius_move_facts</span><span class="p">(</span><span class="n">all_facts</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">AllFacts</span><span class="p">,</span><span class="w"> </span><span class="n">move_data</span>: <span class="kp">&amp;</span><span class="nc">MoveData</span><span class="o">&lt;</span><span class="na">&#39;_</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">_location_table</span>: <span class="kp">&amp;</span><span class="nc">LocationTable</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">all_facts</span><span class="p">.</span><span class="n">var_starts_path</span><span class="p">.</span><span class="n">extend</span><span class="p">(</span><span class="n">move_data</span><span class="p">.</span><span class="n">rev_lookup</span><span class="p">.</span><span class="n">iter_locals_enumerated</span><span class="p">().</span><span class="n">map</span><span class="p">(</span><span class="o">|</span><span class="p">(</span><span class="n">v</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">m</span><span class="p">)</span><span class="o">|</span><span class="w"> </span><span class="p">(</span><span class="n">v</span><span class="p">,</span><span class="w"> </span><span class="n">m</span><span class="p">)));</span><span class="w"></span>

<span class="w">    </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">idx</span><span class="p">,</span><span class="w"> </span><span class="n">move_path</span><span class="p">)</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">move_data</span><span class="p">.</span><span class="n">move_paths</span><span class="p">.</span><span class="n">iter_enumerated</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">all_facts</span><span class="p">.</span><span class="n">parent</span><span class="p">.</span><span class="n">extend</span><span class="p">(</span><span class="n">move_path</span><span class="p">.</span><span class="n">parents</span><span class="p">(</span><span class="o">&amp;</span><span class="n">move_data</span><span class="p">.</span><span class="n">move_paths</span><span class="p">).</span><span class="n">iter</span><span class="p">().</span><span class="n">map</span><span class="p">(</span><span class="o">|&amp;</span><span class="n">parent</span><span class="o">|</span><span class="w"> </span><span class="p">(</span><span class="n">parent</span><span class="p">,</span><span class="w"> </span><span class="n">idx</span><span class="p">)));</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>I would have expected the "interesting" <code>MoveIndex</code>es to also have <code>parent</code>s, but they don't? Is this because my program isn't interesting enough (i.e. compiles)?</p>



<a name="171607979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171607979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171607979">(Jul 24 2019 at 13:56)</a>:</h4>
<p>Perhaps I should hold off judgement until I have Init events and see where that would get me</p>



<a name="171612001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171612001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171612001">(Jul 24 2019 at 14:43)</a>:</h4>
<p>Also, when looking at the <code>Init</code>struct, the documentation says that "initializations can be from an argument or from a statement". What does it mean for an initialisation to happen in an argument?</p>



<a name="171630658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171630658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171630658">(Jul 24 2019 at 18:28)</a>:</h4>
<blockquote>
<p>Also, when looking at the <code>Init</code>struct, the documentation says that "initializations can be from an argument or from a statement". What does it mean for an initialisation to happen in an argument?</p>
</blockquote>
<p>given <code>fn f(x: i32) {}</code> <code>x</code> is initialized "before the function starts". That's recorded as an initialization from an assignment</p>



<a name="171630966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171630966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171630966">(Jul 24 2019 at 18:32)</a>:</h4>
<p>For the other stuff it would be helpful to see the function that you're testing on and output facts</p>



<a name="171640795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171640795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171640795">(Jul 24 2019 at 20:32)</a>:</h4>
<p>I'll do some more thinking tomorrow and see if I can figure out what I would even expect it to do and let you know. There <em>is</em> a chance that it actually works and that I'm just confused. I think I should have most of the logic for calculating <code>var_maybe_initialized_on_exit</code>(which should probably be called <code>var_maybe_partially_initialized_on_exit</code>, but that's just too long)</p>



<a name="171679550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171679550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171679550">(Jul 25 2019 at 10:28)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> Ok, so I put everything together and added some compare functionality similar to what I did for provenance variable liveness. I haven't verified that the parenthood relationship works yet, but I have identified a definite problem with terminators that I don't know how to handle, and would very much appreciate your input on.</p>
<p><strong>Situation</strong>: there is a basic block, (N) with a terminator <code>terminator(N)</code> that performs one or more function calls with moves (of  <code>m</code>) and one assignment (of <code>a</code>), like <code>a = foo(move m)</code>, with terminators going to a block (<code>RETURN</code>) and (<code>UNWIND</code>).<br>
<strong>What should happen</strong>: it's unclear to me whether <code>m</code> should be considered initialised in <code>terminator(N)</code>. Does the move always happen before the call? However, it <em>is</em> clear to me that in <code>RETURN</code>, <code>m</code>should be deinitialised (definitely), and <code>a</code>should be initialised (definitely).<br>
<strong>What actually happens</strong>: the rustc-generated <code>var_maybe_initialized_on_exit</code> has:<br>
-  <code>var_maybe_initialized_on_exit(a, terminator(N)) = False.</code><br>
- <code>var_maybe_initialized_on_exit(a, start(RETURN)) = True.</code><br>
- <code>var_maybe_initialized_on_exit(a, start(UNWIND)) = False.</code><br>
- <code>var_maybe_initialized_on_exit(m, start(UNWIND)) = False.</code></p>
<p>However, as Polonius doesn't see the difference between a terminator and a regular point in the program-flow, in other words it treats both arms the same: both the move and the initialisation happens before the unwind arm.</p>
<p><strong>Suggested fix</strong>: Would it be sufficient to just emit <code>initialized_at(a, start(RETURN))</code> in this case, you think?</p>



<a name="171729877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171729877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171729877">(Jul 25 2019 at 21:38)</a>:</h4>
<p>Livened is able to ignore most of this due to how MIR is constructed. Moving the initialization to the start of the return block is the correct fix for now. I should probably go through the handling of calls in MIR again sometime, because it's a bit of a hack that doesn't easily port to polonius.</p>



<a name="171777067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171777067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171777067">(Jul 26 2019 at 14:15)</a>:</h4>
<p>Ok, I'll try that and see what else breaks/was already broken. :)</p>



<a name="171777084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/171777084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#171777084">(Jul 26 2019 at 14:16)</a>:</h4>
<p>Thanks!</p>



<a name="172216605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172216605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172216605">(Aug 01 2019 at 12:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> Ok, I'm almost there now. I just have two problems left:<br>
- my emitted facts and the ones in Polonius don't always agree on when a move caused by a function call happens. This is a bit confusing, as I just emit facts straight from <code>MoveData</code>. I'll have a look at that later, but:<br>
- I currently don't know how to set function arguments as initialised. I know I can find them in <code>MoveData::inits</code>, but they don't have a <code>Location</code>of any kind in the case of an <code>InitLocation::Argument</code>. So I guess my question is: how do I find the <code>Location</code>of the start of the function taking a <code>Local</code>as argument?</p>



<a name="172216665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172216665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172216665">(Aug 01 2019 at 12:42)</a>:</h4>
<p>(or, I guess I could just find all functions and mark their arguments as initialised if that's easier)</p>



<a name="172218167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172218167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172218167">(Aug 01 2019 at 13:04)</a>:</h4>
<p><code>InitLocation:: Argument</code> really should be <code>Parameter</code>, it  should be fine to use the start point of the CFG for them.</p>



<a name="172218214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172218214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172218214">(Aug 01 2019 at 13:05)</a>:</h4>
<p>Hmh, and how would I find that?</p>



<a name="172218288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172218288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172218288">(Aug 01 2019 at 13:06)</a>:</h4>
<p>I mean, I do have access to the MIR <code>Body</code>, but how do I even tell which function I am in?</p>



<a name="172218305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172218305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172218305">(Aug 01 2019 at 13:06)</a>:</h4>
<p>Or is it one <code>Body</code>per function?</p>



<a name="172218327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172218327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172218327">(Aug 01 2019 at 13:07)</a>:</h4>
<p>Ah yes, ok</p>



<a name="172236223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172236223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172236223">(Aug 01 2019 at 16:27)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> Ok, now the calculated <code>var_maybe_initialized_on_exit</code>:s actually produce the same <code>region_live_at</code> values for all inputs (yay!), and mostly the same input facts as Rust. I still have a problem with moves in function calls though. For example, I have a function like this:</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">13</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">data</span>: <span class="kp">&amp;</span><span class="nc">x</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="w">    </span><span class="n">println</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;y = {:?}&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">y</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="n">println</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;x = {:?}&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>It has  <a href="/user_uploads/4715/l96eRsR9pC4SIjKHhGDvgy4b/rustc.main.-.nll.0.pdf" target="_blank" title="rustc.main.-.nll.0.pdf">this MIR</a>, and <a href="/user_uploads/4715/kMUWbz-hs6KW1dHiNiUBOgpD/drop-liveness-error-polonius.pdf" target="_blank" title="drop-liveness-error-polonius.pdf">these Polonius inputs/results</a>. Notably, the only difference to the expected values is the status of the moved variables <code>_25</code> and <code>_46</code>. The discrepancy happens for <code>_25</code> after the terminator <code>_23 = const std::fmt::ArgumentV1::&lt;'_&gt;::new::&lt;Foo&lt;'_&gt;&gt;(move _24, move _25)</code>. In the facts I generate, <code>_25</code>is immediately moved and so is moved on entry to bb2, and on the entire unwind path. In the inputs from rustc (which may be buggy), it is moved by a <code>StorageDead</code> immediately upon entry to 2, but also magically resurrects at the end of the unwind path (in the <code>resume</code> block); despite both versions agreeing that it's uninitialised in both predecessor blocks (3 and 8).</p>
<p>The same thing (except the magical resurrection) happens to <code>_46</code>.</p>
<p>What is the expected behaviour here? Can a move in a terminator somehow not happen? Why is the first argument moved and not the second one?</p>



<a name="172257874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172257874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172257874">(Aug 01 2019 at 20:23)</a>:</h4>
<p>I can't get the polonius inputs pdf to load correctly</p>



<a name="172258072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172258072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172258072">(Aug 01 2019 at 20:25)</a>:</h4>
<p><code>_25</code> and <code>_46</code> definitely shouldn't be initialized after the function calls.</p>



<a name="172287942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172287942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172287942">(Aug 02 2019 at 06:51)</a>:</h4>
<p>Ok, then I’ll have a closer look at the other reported differences and see if they are identical and if so consider it a bug in the current fact generation</p>



<a name="172309993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172309993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172309993">(Aug 02 2019 at 13:50)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> Ok, I have gone through the cases where my output is different from Rustc's, and in almost all cases it's the same problem (a move in a function call not happening until a later <code>StorageDead</code>). In the other two cases it must also be a bug, because they have variables suddenly being initialised without ever having even been even mentioned in the MIR. In other words, I think the computed <code>var_maybe_initialised_on_exit</code>is now correct, with some degree of confidence.</p>
<p>The question now becomes what to do with the old facts. I would like to remove the old <code>var_initialised_on_exit</code>logic from rustc, and possibly also the entire input fact from Polonius, because it was always an ugly hack. However, that means I can no longer run the comparison tests (some of which fail spuriously anyway).</p>
<p>That also has a follow-on question, which is: should I also throw away the <code>region_live_at</code> input, which I now also have logic to calculate? Similar problems apply here: that would mean that we lose the infrastructure for verifying it, but on the other hand, we already have.</p>
<p>Finally, I could extend the Polonius grammar to also have support for formulating all the initialisation-related facts. This is probably a prerequisite for testing them at all, but it would also be a lot of work for little gain.</p>
<p>What do you think I should do?</p>



<a name="172310713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172310713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172310713">(Aug 02 2019 at 13:59)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span>  to removing the licenses and initialized on exit facts.</p>



<a name="172310741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172310741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172310741">(Aug 02 2019 at 13:59)</a>:</h4>
<p>"licenses"?</p>



<a name="172312663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172312663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172312663">(Aug 02 2019 at 14:24)</a>:</h4>
<p>Liveness</p>



<a name="172315401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172315401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172315401">(Aug 02 2019 at 14:58)</a>:</h4>
<p>ah, ok! And what do I do about the tests?</p>



<a name="172332088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172332088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172332088">(Aug 02 2019 at 18:39)</a>:</h4>
<p>Remove them</p>



<a name="172336001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172336001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172336001">(Aug 02 2019 at 19:33)</a>:</h4>
<p>This is going to be <em>so</em> satisfying :)</p>



<a name="172508799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172508799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172508799">(Aug 05 2019 at 14:30)</a>:</h4>
<p>I'm a bit confused about something that should be basic datafrog, but for some reason doesn't work as I expect it to. So I'm fixing a bug in the liveness calculations by filtering out initial values for <code>var_drop_live_at</code>to only contain variables that are actually initialised when they were dropped. I create a static variable for the <code>var_drop_used</code> <br>
 relation for use with leapjoins, and then I proceed like this:</p>
<div class="codehilite"><pre><span></span><span class="c1">// var_drop_live(V, P) :-</span>
<span class="c1">//     var_drop_used(V, P),</span>
<span class="c1">//     var_maybe_initialzed_on_exit(V, P).</span>
<span class="n">var_drop_live_var</span><span class="p">.</span><span class="n">from_leapjoin</span><span class="p">(</span><span class="w"></span>
<span class="w">      </span><span class="o">&amp;</span><span class="n">var_drop_used_var</span><span class="p">,</span><span class="w"></span>
<span class="w">      </span><span class="n">var_maybe_initialized_on_exit_rel</span><span class="p">.</span><span class="n">extend_with</span><span class="p">(</span><span class="o">|&amp;</span><span class="p">(</span><span class="n">v</span><span class="p">,</span><span class="w"> </span><span class="n">_p</span><span class="p">)</span><span class="o">|</span><span class="w"> </span><span class="n">v</span><span class="p">),</span><span class="w"></span>
<span class="w">      </span><span class="o">|&amp;</span><span class="p">(</span><span class="n">v</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">),</span><span class="w"> </span><span class="o">&amp;</span><span class="n">p</span><span class="o">|</span><span class="w"> </span><span class="p">(</span><span class="n">v</span><span class="p">,</span><span class="w"> </span><span class="n">p</span><span class="p">)</span><span class="w"></span>
<span class="w">  </span><span class="p">);</span><span class="w"></span>
</pre></div>


<p>Shouldn't this do a join on V, excluding any V:s not in both <code>var_maybe_initialized_on_exit</code> and <code>var_drop_used</code>? Or have I misunderstood how this works? Also, I don't understand why I get wildly different outputs depending on which tuple I select <code>p</code>from?</p>



<a name="172508826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172508826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172508826">(Aug 05 2019 at 14:30)</a>:</h4>
<p>(Ping <span class="user-mention" data-user-id="116113">@lqd</span> who maybe knows and perhaps doesn't hang around here)</p>



<a name="172510688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172510688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172510688">(Aug 05 2019 at 14:56)</a>:</h4>
<p>As far as I can tell, it behaves like an outer join!?</p>



<a name="172532332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172532332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172532332">(Aug 05 2019 at 19:49)</a>:</h4>
<p>Update: it's not that, because the same thing happens if I make the "join" myself, but the facts _are_ correct and there should never be any join. I don't understand!? HOW can <code>var_drop_live_at</code> be true for <code>_2</code> here? It's very clearly not in <code>var_maybe_initialized_on_exit</code>: <br>
<a href="/user_uploads/4715/LkH_WskCHFh6xuC6rq471KzH/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/LkH_WskCHFh6xuC6rq471KzH/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/LkH_WskCHFh6xuC6rq471KzH/pasted_image.png"></a></div>



<a name="172532460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172532460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172532460">(Aug 05 2019 at 19:50)</a>:</h4>
<p>(The name "<code>_on_exit</code>" is also wrong, it should be <code>on_entry</code>I guess?)</p>



<a name="172534388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534388">(Aug 05 2019 at 20:14)</a>:</h4>
<p>(sorry I'm on holidays and missed the ping)</p>



<a name="172534423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534423">(Aug 05 2019 at 20:15)</a>:</h4>
<p>IIUC you're effectively encoding an outer join</p>



<a name="172534444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534444">(Aug 05 2019 at 20:15)</a>:</h4>
<p>but the datalog does not only join on V here</p>



<a name="172534503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534503">(Aug 05 2019 at 20:16)</a>:</h4>
<p>P is also present in both relations</p>



<a name="172534573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534573">(Aug 05 2019 at 20:17)</a>:</h4>
<p>what you're looking for, IIUC, is to filter the (V, P)s present in both relations only</p>



<a name="172534628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534628">(Aug 05 2019 at 20:18)</a>:</h4>
<p>however, this won't be possible/easy (it's a gamble depending on the data) with a leapjoin for now</p>



<a name="172534736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534736">(Aug 05 2019 at 20:19)</a>:</h4>
<p>they have a weird under-specified/undocumented criterion wrt well-formedness, that is they expect to have a least one <code>extend_with</code> (I think) and even though that's what you have here the leaper for the join should probably be <code>filter_with</code> — but if you do that the leapjoin won't be well-formed anymore (until at least until we relax this requirement in <span aria-label="frog" class="emoji emoji-1f438" role="img" title="frog">:frog:</span>)</p>



<a name="172534739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534739">(Aug 05 2019 at 20:19)</a>:</h4>
<p>Haha, I just spent 20 minutes trying to figure out how this happened and was <em>so proud</em> of myself for figuring it out, only to realise you just replied :)</p>



<a name="172534804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534804">(Aug 05 2019 at 20:20)</a>:</h4>
<p>That was after literal hours of debugging earlier today</p>



<a name="172534821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534821">(Aug 05 2019 at 20:20)</a>:</h4>
<p>so, what you're looking for here is a regular join between variables/relations setup to filter, that is, where the whole tuple is a "key" like ((V,P), ()) — there are examples of that in the naive/datafrogopt variants IIRC</p>



<a name="172534827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534827">(Aug 05 2019 at 20:21)</a>:</h4>
<p>sorry :)</p>



<a name="172534843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534843">(Aug 05 2019 at 20:21)</a>:</h4>
<p>Oh that's by no means your fault :)</p>



<a name="172534852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534852">(Aug 05 2019 at 20:21)</a>:</h4>
<p>still good that you were able to figure it out on your own :)</p>



<a name="172534882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534882">(Aug 05 2019 at 20:21)</a>:</h4>
<p>But great, now I think I know how to proceed yay</p>



<a name="172534949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172534949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172534949">(Aug 05 2019 at 20:22)</a>:</h4>
<p>yeah once you know how to encode this pattern you'll be good I think</p>



<a name="172535010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535010">(Aug 05 2019 at 20:23)</a>:</h4>
<p>the <code>borrow_live_at</code> <a href="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/naive.rs#L55" target="_blank" title="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/naive.rs#L55">here</a> is a good example</p>



<a name="172535080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535080">(Aug 05 2019 at 20:24)</a>:</h4>
<p>the join is <a href="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/naive.rs#L150-L156" target="_blank" title="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/naive.rs#L150-L156">here</a> (to fill it) and an example of using it in a join <a href="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/naive.rs#L158" target="_blank" title="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/naive.rs#L158">here</a> and <code>invalidates</code> is also setup the same way <a href="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/naive.rs#L58" target="_blank" title="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/naive.rs#L58">here</a></p>



<a name="172535082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535082">(Aug 05 2019 at 20:24)</a>:</h4>
<p>It looks like literally the same pattern, but with a 3-tuple</p>



<a name="172535091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535091">(Aug 05 2019 at 20:24)</a>:</h4>
<p>And I also looked at it earlier today when trying to figure out if I did something wrong</p>



<a name="172535115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535115">(Aug 05 2019 at 20:24)</a>:</h4>
<p>Oh well, I'll go to sleep first I guess</p>



<a name="172535118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535118">(Aug 05 2019 at 20:24)</a>:</h4>
<p>Thank you! :)</p>



<a name="172535145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535145">(Aug 05 2019 at 20:25)</a>:</h4>
<p>the datalog-to-datafrog encoding is a bit hard to read immediately after writing it :)</p>



<a name="172535169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535169">(Aug 05 2019 at 20:25)</a>:</h4>
<p>it's .. a bit unreadable for sure</p>



<a name="172535224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535224">(Aug 05 2019 at 20:26)</a>:</h4>
<p>you're very welcome, at least I knew how to help here :)</p>



<a name="172535902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172535902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172535902">(Aug 05 2019 at 20:35)</a>:</h4>
<p>(I updated an earlier message to add another case which is even more similar, encoding <code>errors(B, P) :- invalidates(B, P), borrow_live_at(B, P).</code>)</p>



<a name="172566975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172566975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172566975">(Aug 06 2019 at 07:42)</a>:</h4>
<p>Ok so now I think I have a different bug in my actual logic haha</p>



<a name="172566995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172566995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172566995">(Aug 06 2019 at 07:43)</a>:</h4>
<p>Because I currently ignore <em>all</em> drops of uninitialised variables, and that's not correct is it? At least, that gives different region liveness from the one supplied by rustc</p>



<a name="172567326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172567326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172567326">(Aug 06 2019 at 07:50)</a>:</h4>
<p>Ah, I see the bug now. At a <code>drop()</code>, I only consider a variable actually drop-used if it is initialised, but there's an off-by-one error in this logic: it's a tautology that <code>drop(x)</code> means <code>x</code>is not initialised on exit from that statement. I need to join on the <em>previous</em> statement.</p>



<a name="172567394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172567394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172567394">(Aug 06 2019 at 07:52)</a>:</h4>
<p>(which will always be just one statement because the drop always occurs mid-point)</p>



<a name="172568473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172568473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172568473">(Aug 06 2019 at 08:12)</a>:</h4>
<p>Wohooo that did it!</p>



<a name="172568486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172568486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172568486">(Aug 06 2019 at 08:12)</a>:</h4>
<p>And using only joins on relations no less</p>



<a name="172569684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172569684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172569684">(Aug 06 2019 at 08:33)</a>:</h4>
<p>In the process of debugging this, I also made a Python script that takes the input from cargo test and produces readable output in Markdown, should I put that somewhere in case it's useful to anyone else?</p>



<a name="172569769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172569769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172569769">(Aug 06 2019 at 08:35)</a>:</h4>
<p>It looks something like this:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> cargo <span class="nb">test</span> implicit_fragment <span class="p">|</span> ./parse-diff-output.py
<span class="go">    Finished dev [unoptimized + debuginfo] target(s) in 0.07s</span>
<span class="go">     Running target/debug/deps/polonius-55bdf7bb7cdabdf9</span>
<span class="go">error: test failed, to rerun pass &#39;--lib&#39;</span>
<span class="gp">#</span><span class="c1"># `maybe_initialized_drop_implicit_fragment_drop_main::computed_region_live_at_same_as_input`</span>
<span class="go">- `Start(bb3[0])`:  **missing**: _#13r</span>
<span class="go">- `Mid(bb3[0])`:    **missing**: _#13r</span>
<span class="go">- `Start(bb7[5])`:  **missing**: _#16r</span>
<span class="go">- `Mid(bb7[5])`:    **missing**: _#16r</span>
<span class="go">- `Start(bb8[0])`:  **missing**: _#16r</span>
<span class="go">- `Mid(bb8[0])`:    **missing**: _#16r</span>
<span class="go">- `Start(bb9[0])`:  **missing**: _#16r</span>
<span class="go">- `Mid(bb9[0])`:    **missing**: _#16r</span>
<span class="go">- `Start(bb10[0])`: **missing**: _#16r</span>
<span class="go">- `Mid(bb10[0])`:   **missing**: _#16r</span>
<span class="go">- `Start(bb11[0])`: **missing**: _#16r</span>
<span class="go">- `Mid(bb11[0])`:   **missing**: _#16r</span>
<span class="go">- `Start(bb11[1])`: **missing**: _#16r</span>
<span class="go">- `Mid(bb11[1])`:   **missing**: _#16r</span>
<span class="go">- `Start(bb11[2])`: **missing**: _#16r</span>
<span class="go">- `Mid(bb11[2])`:   **missing**: _#16r</span>
<span class="go">- `Start(bb11[3])`: **missing**: _#16r</span>
<span class="go">- `Mid(bb11[3])`:   **missing**: _#16r</span>
<span class="go">- `Start(bb11[4])`: **missing**: _#16r</span>
<span class="go">- `Mid(bb11[4])`:   **missing**: _#16r</span>
</pre></div>



<a name="172569806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172569806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172569806">(Aug 06 2019 at 08:35)</a>:</h4>
<p>Hmh, maybe it's not useful anymore now that the big <code>region_live_at</code>comparisons are soon gone</p>



<a name="172690420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172690420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172690420">(Aug 07 2019 at 15:57)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> cc <span class="user-mention" data-user-id="116113">@lqd</span> </p>
<p>Ok, I have finished generating <code>var_maybe_initialized_on_exit</code> and have removed <code>region_live_at</code>. Last time I checked, it passed all tests, but I'm currently having some troubles in the methods comparing the location-insensitive analysis to the full one. I don't understand them yet, but will debug later.</p>
<p>My implementation doesn't do the full move analysis, but I have fact generation for path access, and I have written comments mocking the Datalog I think is needed. I think it's come to the point where there's a point in having someone take a look at it, if you have the time. There's no rush, because I'm leaving for some vacation until August 15th.</p>
<p>I'm thinking that I should not try to finish the full move analysis as part of my thesis work as Matthew suggested. I will also leave the job of updating polonius-parser to work with these gazillion new facts, but I will absolutely try to do that at some point, just not under deadline.</p>
<p>PRs are at <a href="https://github.com/rust-lang-nursery/polonius/issues/110" target="_blank" title="https://github.com/rust-lang-nursery/polonius/issues/110">polonius#110</a> and <a href="https://github.com/rust-lang/rust/issues/62800" target="_blank" title="https://github.com/rust-lang/rust/issues/62800">rust#62800</a>, but they don't have the updated facts yet.</p>



<a name="172709246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172709246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172709246">(Aug 07 2019 at 19:48)</a>:</h4>
<p>nicely done :)</p>



<a name="172709296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172709296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172709296">(Aug 07 2019 at 19:49)</a>:</h4>
<p>don't worry about the parser I can take care of that</p>



<a name="172709442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172709442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172709442">(Aug 07 2019 at 19:50)</a>:</h4>
<p>I think Matthew or Niko would be better than me looking at the rustc side but I can look at the polonius for sure</p>



<a name="172709494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/172709494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#172709494">(Aug 07 2019 at 19:51)</a>:</h4>
<p>(I'll myself be back from vacation around the same time as you)</p>



<a name="173384113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173384113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173384113">(Aug 16 2019 at 15:46)</a>:</h4>
<p>Ok, I have done some further hunting of the bug I mentioned. The problem is this: Polonius + rustc with my latest changes reports no errors for smoke-test's <code>return_ref_to_local()</code>. Or rather, my new logic, including the new <code>region_live_at</code>, works fine. However, sometime after I remove <code>region_live_at</code>, the new fact generation (or Polonius) somehow changes behaviour and it stops working. This is very weird because the problem seems to stem from incorrect subset relation propagation, but there are no changes to either that part of the code, nor to any related fact generation code, and as far as I can tell, the inputs are identical.</p>
<p>Last good commit on my branch is <a href="https://github.com/albins/polonius/commit/6b0fc8e6cf0cc5019af26a32898ae8c0064592dd" target="_blank" title="https://github.com/albins/polonius/commit/6b0fc8e6cf0cc5019af26a32898ae8c0064592dd">https://github.com/albins/polonius/commit/6b0fc8e6cf0cc5019af26a32898ae8c0064592dd</a>, and the last good one on my Rustc branch is <a href="https://github.com/albins/rust/commit/c265a4108307ede999049c71650f95bd2d539d5e" target="_blank" title="https://github.com/albins/rust/commit/c265a4108307ede999049c71650f95bd2d539d5e">https://github.com/albins/rust/commit/c265a4108307ede999049c71650f95bd2d539d5e</a>.</p>



<a name="173384161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173384161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173384161">(Aug 16 2019 at 15:47)</a>:</h4>
<p>I'll continue looking at this tomorrow, but I just can't wrap my head around it!</p>



<a name="173399239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173399239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173399239">(Aug 16 2019 at 19:07)</a>:</h4>
<p>Ok, this is nuts. I have the following in the correct output (HEAD of my master branch):<br>
<a href="/user_uploads/4715/yYyEKevRrZjI44698V6Hz6Pu/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/yYyEKevRrZjI44698V6Hz6Pu/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/yYyEKevRrZjI44698V6Hz6Pu/pasted_image.png"></a></div><p>and then I have this at HEAD of my working branch:<br>
<a href="/user_uploads/4715/vloc_-mACT7cgHNzSFaThe-r/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/vloc_-mACT7cgHNzSFaThe-r/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/vloc_-mACT7cgHNzSFaThe-r/pasted_image.png"></a></div><p>Those are...the same facts?! Also, this is my diff of <code>naive.rs</code>:</p>
<div class="codehilite"><pre><span></span><span class="gh">diff --git a/polonius-engine/src/output/naive.rs b/polonius-engine/src/output/naive.rs</span>
<span class="gh">index 1cf252ed16..028fdfd4d3 100644</span>
<span class="gd">--- a/polonius-engine/src/output/naive.rs</span>
<span class="gi">+++ b/polonius-engine/src/output/naive.rs</span>
<span class="gu">@@ -13,26 +13,37 @@</span>
 use std::collections::{BTreeMap, BTreeSet};
 use std::time::Instant;

<span class="gi">+use crate::output::initialization;</span>
 use crate::output::liveness;
 use crate::output::Output;
 use facts::{AllFacts, Atom};

 use datafrog::{Iteration, Relation, RelationLeaper};

<span class="gd">-pub(super) fn compute&lt;Region: Atom, Loan: Atom, Point: Atom, Variable: Atom&gt;(</span>
<span class="gi">+pub(super) fn compute&lt;Region: Atom, Loan: Atom, Point: Atom, Variable: Atom, MovePath: Atom&gt;(</span>
     dump_enabled: bool,
<span class="gd">-    all_facts: AllFacts&lt;Region, Loan, Point, Variable&gt;,</span>
<span class="gd">-) -&gt; Output&lt;Region, Loan, Point, Variable&gt; {</span>
<span class="gi">+    all_facts: AllFacts&lt;Region, Loan, Point, Variable, MovePath&gt;,</span>
<span class="gi">+) -&gt; Output&lt;Region, Loan, Point, Variable, MovePath&gt; {</span>
     let mut result = Output::new(dump_enabled);

<span class="gi">+    let var_maybe_initialized_on_exit = initialization::init_var_maybe_initialized_on_exit(</span>
<span class="gi">+        all_facts.child,</span>
<span class="gi">+        all_facts.path_belongs_to_var,</span>
<span class="gi">+        all_facts.initialized_at,</span>
<span class="gi">+        all_facts.moved_out_at,</span>
<span class="gi">+        all_facts.path_accessed_at,</span>
<span class="gi">+        &amp;all_facts.cfg_edge,</span>
<span class="gi">+        &amp;mut result,</span>
<span class="gi">+    );</span>
<span class="gi">+</span>
     let region_live_at = liveness::init_region_live_at(
         all_facts.var_used,
         all_facts.var_drop_used,
         all_facts.var_defined,
         all_facts.var_uses_region,
         all_facts.var_drops_region,
<span class="gi">+        var_maybe_initialized_on_exit,</span>
         &amp;all_facts.cfg_edge,
<span class="gd">-        all_facts.region_live_at,</span>
         all_facts.universal_region,
         &amp;mut result,
     );
</pre></div>



<a name="173533550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173533550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173533550">(Aug 19 2019 at 10:39)</a>:</h4>
<p>Update: it's a fact generation bug. The dereferencing of <code>_2</code>never causes a use-fact to be emitted. I think this may be due to the lazy reference generation? I.e. <code>_2</code> is dereferenced, but only to create a copy, it seems?</p>
<p>What I think should happen if I understand the reasoning correctly is that Polonius should infer through outlives relations that _0 outlives the value it is referring to and return an error, presumably when the value is moved by the <code>StorageDead()</code> just before the terminator, but the propagation of the outlives relation relies on the liveness of <code>_2</code>'s provenance variable, r6.</p>
<p>Here is the MIR:</p>
<div class="codehilite"><pre><span></span><span class="n">StorageLive</span><span class="p">(</span><span class="n">_1</span><span class="p">)</span><span class="w"></span>
<span class="n">_1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="mi">0</span><span class="k">i32</span><span class="w"></span>
<span class="n">FakeRead</span><span class="p">(</span><span class="n">ForLet</span><span class="p">,</span><span class="w"> </span><span class="n">_1</span><span class="p">)</span><span class="w"></span>
<span class="n">StorageLive</span><span class="p">(</span><span class="n">_2</span><span class="p">)</span><span class="w"></span>
<span class="n">_2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">_1</span><span class="w"></span>
<span class="n">_0</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="p">(</span><span class="o">*</span><span class="n">_2</span><span class="p">)</span><span class="w"></span>
<span class="n">StorageDead</span><span class="p">(</span><span class="n">_1</span><span class="p">)</span><span class="w"></span>
<span class="n">StorageDead</span><span class="p">(</span><span class="n">_2</span><span class="p">)</span><span class="w"></span>
</pre></div>


<p>Also, should a used variable be considered used at the start of the expression where it is used, or mid-point?</p>



<a name="173533751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173533751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173533751">(Aug 19 2019 at 10:42)</a>:</h4>
<p>As a reminder, I use the following MIR Visitor to extract variable uses:</p>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="w"> </span><span class="n">Visitor</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">UseFactsExtractor</span><span class="o">&lt;</span><span class="na">&#39;_</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">visit_local</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">local</span>: <span class="kp">&amp;</span><span class="nc">Local</span><span class="p">,</span><span class="w"> </span><span class="n">context</span>: <span class="nc">PlaceContext</span><span class="p">,</span><span class="w"> </span><span class="n">location</span>: <span class="nc">Location</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">match</span><span class="w"> </span><span class="n">categorize</span><span class="p">(</span><span class="n">context</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="nb">Some</span><span class="p">(</span><span class="n">DefUse</span>::<span class="n">Def</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">insert_def</span><span class="p">(</span><span class="n">local</span><span class="p">,</span><span class="w"> </span><span class="n">location</span><span class="p">),</span><span class="w"></span>
<span class="w">            </span><span class="nb">Some</span><span class="p">(</span><span class="n">DefUse</span>::<span class="n">Use</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">insert_use</span><span class="p">(</span><span class="n">local</span><span class="p">,</span><span class="w"> </span><span class="n">location</span><span class="p">),</span><span class="w"></span>
<span class="w">            </span><span class="nb">Some</span><span class="p">(</span><span class="n">DefUse</span>::<span class="nb">Drop</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">insert_drop_use</span><span class="p">(</span><span class="n">local</span><span class="p">,</span><span class="w"> </span><span class="n">location</span><span class="p">),</span><span class="w"></span>
<span class="w">            </span><span class="n">_</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">(),</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>Clearly there is some type of use I am missing here?</p>



<a name="173533799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173533799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173533799">(Aug 19 2019 at 10:43)</a>:</h4>
<p>(I now also use the same Visitor to visit places and emit move-path-uses for future move analysis)</p>



<a name="173537244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173537244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173537244">(Aug 19 2019 at 11:47)</a>:</h4>
<p>You're missing a <code>super_place</code> call in your <code>visit_place</code> override.</p>



<a name="173538798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173538798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173538798">(Aug 19 2019 at 12:14)</a>:</h4>
<p>What does that do?</p>



<a name="173539674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173539674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173539674">(Aug 19 2019 at 12:28)</a>:</h4>
<p>well it...makes the rest work. :)</p>



<a name="173539676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173539676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173539676">(Aug 19 2019 at 12:28)</a>:</h4>
<p>Thank you!</p>



<a name="173545077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173545077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173545077">(Aug 19 2019 at 13:49)</a>:</h4>
<p>HA, ok <span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://github.com/rust-lang-nursery/polonius/issues/110" target="_blank" title="https://github.com/rust-lang-nursery/polonius/issues/110">polonius#110</a> and <a href="https://github.com/rust-lang/rust/issues/62800" target="_blank" title="https://github.com/rust-lang/rust/issues/62800">rust#62800</a> are ready for review!</p>



<a name="173545099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173545099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173545099">(Aug 19 2019 at 13:49)</a>:</h4>
<p>...presuming it passes the tests</p>



<a name="173545153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/173545153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#173545153">(Aug 19 2019 at 13:50)</a>:</h4>
<p>But it Does On My Machine™</p>



<a name="174260520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174260520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174260520">(Aug 27 2019 at 19:11)</a>:</h4>
<blockquote>
<p>HA, ok <span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="https://github.com/rust-lang-nursery/polonius/issues/110" target="_blank" title="https://github.com/rust-lang-nursery/polonius/issues/110">polonius#110</a> and <a href="https://github.com/rust-lang/rust/issues/62800" target="_blank" title="https://github.com/rust-lang/rust/issues/62800">rust#62800</a> are ready for review!</p>
</blockquote>
<p>just saw this</p>



<a name="174260532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174260532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174260532">(Aug 27 2019 at 19:11)</a>:</h4>
<p>Great!</p>



<a name="174530249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174530249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174530249">(Aug 30 2019 at 09:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Ok, I have been thinking about your comments on <code>var_maybe_initialized_on_exit</code> a lot. I think the case is as follows:</p>
<ul>
<li>the current code should be equivalent to what was there before. That is, whenever a variable had some path initialized, the variable was considered initialized. <a href="https://github.com/albins/rust/commit/c265a4108307ede999049c71650f95bd2d539d5e" target="_blank" title="https://github.com/albins/rust/commit/c265a4108307ede999049c71650f95bd2d539d5e">[Commit removing old logic]</a>. What I used was <code>self.cx.flow_inits.has_any_child_of(move_path)</code>, which must mean that, right?</li>
<li>the reason for doing this was when calculating drop-liveness <em>of a reference</em> (since that is the only liveness Polonius cares about), like this:</li>
</ul>
<div class="codehilite"><pre><span></span><span class="nf">var_drop_live</span><span class="p">(</span><span class="nv">V</span><span class="p">,</span> <span class="nv">P</span><span class="p">)</span> <span class="p">:-</span>
     <span class="nf">var_drop_used</span><span class="p">(</span><span class="nv">V</span><span class="p">,</span> <span class="nv">P</span><span class="p">),</span>
     <span class="nf">var_maybe_initialized_on_exit</span><span class="p">(</span><span class="nv">V</span><span class="p">,</span> <span class="nv">P</span><span class="p">).</span>
</pre></div>


<ul>
<li>This is where I realise I don't fully understand what is going on there. I remember why we had this problem: we want to keep a reference inside a struct live if that struct implements its own drop, but that drop would only happen if the variable was actually initialised.</li>
<li>However, I don't understand how this logic would connect the dropping of a struct to the references inside of it. I presume there is some intermediate MIR logic here that I am missing?</li>
<li>Given how I understand this, though, I don't see why we would care about the initialisation of anything below root-levels of references. The only path that is interesting is that of a variable holding the reference itself, right? And I presume that doesn't have any children? However, we would never be able to tell the difference with region_live_at if we over-estimated here, which is why I think we haven't seen any problems.</li>
</ul>



<a name="174530726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174530726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174530726">(Aug 30 2019 at 09:54)</a>:</h4>
<p>I also have an idea for how to do move errors:</p>
<ul>
<li>I track maybe initialized paths, precisely as you suggested in the code review</li>
<li>I also track maybe moved paths analogously with initialisations and moves switching places in the transitive closure calculation</li>
<li>therefore, a surely initialised path is maybe initialised paths set-minus maybe moved paths</li>
<li>move errors is accesses set-minus surely initialised paths</li>
</ul>



<a name="174534470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534470">(Aug 30 2019 at 11:06)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span>  </p>
<blockquote>
<p>That is, whenever a variable had some path initialized, the variable was considered initialized. </p>
</blockquote>
<p>Yes, <code>has_any_child_of</code> is saying "if any path that begins with <code>move_path</code> is considered initialized...". That seems to map to the rule for <code>var_maybe_initialized_on_exit</code> for sure.</p>



<a name="174534473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534473">(Aug 30 2019 at 11:07)</a>:</h4>
<p>I'm not sure I fully understand your later  comments, let me take a stab</p>



<a name="174534500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534500">(Aug 30 2019 at 11:07)</a>:</h4>
<p>So, just talking about <strong>MIR</strong>, if you have <code>DROP(x)</code>, that is considered a no-op if <code>x</code> has been moved. We don't always know that statically. In a later phase ("elaborate drops"), we will extend the MIR to either eliminate no-op DROP terminators, or to add boolean variables that conditionally execute them if needed.</p>



<a name="174534555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534555">(Aug 30 2019 at 11:08)</a>:</h4>
<p>In some cases they will be transformed into <code>DROP(x.y.z)</code>, if only some sub-path is initialized.</p>



<a name="174534576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534576">(Aug 30 2019 at 11:09)</a>:</h4>
<p>(But, in those cases, <code>x</code> and <code>x.y</code> cannot have destructors, due to other NLL rules)</p>



<a name="174534591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534591">(Aug 30 2019 at 11:09)</a>:</h4>
<p>(This all makes sense so far?)</p>



<a name="174534675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534675">(Aug 30 2019 at 11:10)</a>:</h4>
<blockquote>
<p>Given how I understand this, though, I don't see why we would care about the initialisation of anything below root-levels of references.</p>
</blockquote>



<a name="174534796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534796">(Aug 30 2019 at 11:12)</a>:</h4>
<p>It's true that the current incarnation of NLL is somewhat restrictive about initialized sub-paths. For example you can't compile code like this, iirc:</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">x</span>: <span class="p">(</span><span class="n">_</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">);</span><span class="w"></span>
<span class="n">x</span><span class="p">.</span><span class="mi">0</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[</span><span class="mi">22</span><span class="p">];</span><span class="w"></span>
<span class="n">v</span><span class="p">.</span><span class="mi">1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[</span><span class="mi">44</span><span class="p">];</span><span class="w"></span>
</pre></div>


<p>but I think we <em>intend</em> to support such things eventually (c.f. <a href="https://github.com/rust-lang/rust/issues/54987" target="_blank" title="https://github.com/rust-lang/rust/issues/54987">https://github.com/rust-lang/rust/issues/54987</a>)</p>



<a name="174534816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534816">(Aug 30 2019 at 11:13)</a>:</h4>
<p>In such a case, you would never have a direct initialization of <code>x</code></p>



<a name="174534880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534880">(Aug 30 2019 at 11:14)</a>:</h4>
<p>I was imagining then a scenario like this:</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">x</span>: <span class="p">(</span><span class="n">_</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">);</span><span class="w"></span>
<span class="n">x</span><span class="p">.</span><span class="mi">0</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">...;</span><span class="w"></span>
<span class="n">std</span>::<span class="n">mem</span>::<span class="n">drop</span><span class="p">(</span><span class="n">x</span><span class="p">.</span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
</pre></div>



<a name="174534911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534911">(Aug 30 2019 at 11:14)</a>:</h4>
<p>If we only tracked initialization at the level of local variables, we would see that <code>x</code> is initialized after <code>x.0 = ...</code> but we couldn't say for sure that <code>x</code> is <strong>not</strong> initialized after <code>std::mem::drop</code>, because we only saw a single field moved and not the entire thing.</p>



<a name="174534938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174534938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174534938">(Aug 30 2019 at 11:15)</a>:</h4>
<p>Anyway, to be clear, I believe that the rules as you wrote them were equivalent to the changes I was suggesting -- but I felt like the setup you had would be a bit less efficient and/or clear.</p>



<a name="174535014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174535014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174535014">(Aug 30 2019 at 11:16)</a>:</h4>
<blockquote>
<ul>
<li>move errors is accesses set-minus surely initialised paths</li>
</ul>
</blockquote>
<p>it seems mildly simpler to say that errors are <code>accessed</code> intersected with <code>maybe_moved</code>?</p>



<a name="174535019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174535019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174535019">(Aug 30 2019 at 11:16)</a>:</h4>
<p>Ah, I guess you also want an error if it is uninitialized, is your point</p>



<a name="174535025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174535025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174535025">(Aug 30 2019 at 11:16)</a>:</h4>
<p>Except that uninitialized things are considered moved to start</p>



<a name="174535547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174535547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174535547">(Aug 30 2019 at 11:26)</a>:</h4>
<p>I see I already wrote a <a href="https://github.com/lark-exploration/lark/blob/87d1e42107ced29f5ef23b70ef66e3b6fa2e74de/components/lark-type-check/src/full_inference/analysis/initialization.rs#L23-L35" target="_blank" title="https://github.com/lark-exploration/lark/blob/87d1e42107ced29f5ef23b70ef66e3b6fa2e74de/components/lark-type-check/src/full_inference/analysis/initialization.rs#L23-L35">summary of how Lark handled things</a> -- it was doing a different sort of analysis than the one you are doing. In particular, it was just doing the "move errors" part. That is, detecting access to uninitialized or moved paths.</p>



<a name="174535557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174535557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174535557">(Aug 30 2019 at 11:26)</a>:</h4>
<p>But some parts are relevant.</p>



<a name="174536006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174536006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174536006">(Aug 30 2019 at 11:35)</a>:</h4>
<p>Re-reading that code, I <em>feel</em> like it too is does more transitive closures than are really necessary</p>



<a name="174537109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174537109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174537109">(Aug 30 2019 at 11:57)</a>:</h4>
<blockquote>
<p>Anyway, to be clear, I believe that the rules as you wrote them were equivalent to the changes I was suggesting -- but I felt like the setup you had would be a bit less efficient and/or clear.</p>
</blockquote>
<p>I guess the key question here is: would that lead to correct calculations of <code>region_live_at</code>?</p>



<a name="174537187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174537187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174537187">(Aug 30 2019 at 11:58)</a>:</h4>
<blockquote>
<p>Except that uninitialized things are considered moved to start</p>
</blockquote>
<p>Avoiding a notion of "to start" is specifically why I went about the acrobatics I described; I don't have any concept of "to start" in Datafrog, right?</p>



<a name="174537211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174537211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174537211">(Aug 30 2019 at 11:58)</a>:</h4>
<p>There is no <code>first_node_of_cfg</code>, and I'd rather not just guess it's index 0</p>



<a name="174823739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174823739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174823739">(Sep 03 2019 at 19:58)</a>:</h4>
<p>so I landed <a href="https://github.com/rust-lang/polonius/pull/110" target="_blank" title="https://github.com/rust-lang/polonius/pull/110">https://github.com/rust-lang/polonius/pull/110</a></p>



<a name="174823744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174823744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174823744">(Sep 03 2019 at 19:58)</a>:</h4>
<p>now we need a new polonius release, right?</p>



<a name="174823749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174823749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174823749">(Sep 03 2019 at 19:58)</a>:</h4>
<p>(am I the only one with such privileges?)</p>



<a name="174823754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174823754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174823754">(Sep 03 2019 at 19:58)</a>:</h4>
<p>Yes please</p>



<a name="174823757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174823757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174823757">(Sep 03 2019 at 19:58)</a>:</h4>
<p>and yes, I think so</p>



<a name="174823778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174823778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174823778">(Sep 03 2019 at 19:59)</a>:</h4>
<p>/me has no idea</p>



<a name="174823982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174823982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174823982">(Sep 03 2019 at 20:01)</a>:</h4>
<p>hmm no it should be more folks</p>



<a name="174823995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174823995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174823995">(Sep 03 2019 at 20:01)</a>:</h4>
<p>I think <span class="user-mention" data-user-id="116113">@lqd</span> can do it, for example</p>



<a name="174824036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824036">(Sep 03 2019 at 20:01)</a>:</h4>
<p>can I ?!</p>



<a name="174824097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824097">(Sep 03 2019 at 20:02)</a>:</h4>
<p>I didn't know that</p>



<a name="174824150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824150">(Sep 03 2019 at 20:02)</a>:</h4>
<p>maybe :)</p>



<a name="174824175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824175">(Sep 03 2019 at 20:03)</a>:</h4>
<p>the wg-compiler-nll github team has access, which I might actually want to revoke, along with the compiler team</p>



<a name="174824186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824186">(Sep 03 2019 at 20:03)</a>:</h4>
<p>but I think I should add the compiler-contributors team</p>



<a name="174824205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824205">(Sep 03 2019 at 20:03)</a>:</h4>
<p>which includes you</p>



<a name="174824216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824216">(Sep 03 2019 at 20:03)</a>:</h4>
<p>you're probably also a member of wg-compiler-nll ...</p>



<a name="174824259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824259">(Sep 03 2019 at 20:04)</a>:</h4>
<p>yes</p>



<a name="174824297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824297">(Sep 03 2019 at 20:04)</a>:</h4>
<p><em>anyway</em> I'll publish v0.10.0</p>



<a name="174824487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824487">(Sep 03 2019 at 20:07)</a>:</h4>
<p>done -- <span class="user-mention" data-user-id="204115">@Albin Stjerna</span> do you want to modify <a href="https://github.com/rust-lang/rust/issues/62800" target="_blank" title="https://github.com/rust-lang/rust/issues/62800">rust#62800</a> to use it?</p>



<a name="174824628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174824628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174824628">(Sep 03 2019 at 20:09)</a>:</h4>
<p>(thanks for the release, I'll learn how to do it in the future so we don't have to bother you :)</p>



<a name="174825266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174825266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174825266">(Sep 03 2019 at 20:16)</a>:</h4>
<p>no worries, I just don't like things to be bottlenecked on me</p>



<a name="174829458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174829458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174829458">(Sep 03 2019 at 21:06)</a>:</h4>
<p>I'll do it tomorrow!</p>



<a name="174829462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174829462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174829462">(Sep 03 2019 at 21:06)</a>:</h4>
<p>Signed, going to bed</p>



<a name="174859197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174859197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174859197">(Sep 04 2019 at 07:53)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  <a href="https://github.com/rust-lang/rust/issues/62800" target="_blank" title="https://github.com/rust-lang/rust/issues/62800">rust#62800</a> should be ready to merge once CI passes!</p>



<a name="174861672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174861672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174861672">(Sep 04 2019 at 08:33)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> ah I see some tidy checks failed, CI didn't get to run yet</p>



<a name="174861792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174861792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174861792">(Sep 04 2019 at 08:35)</a>:</h4>
<p><em>sigh</em> of course</p>



<a name="174861811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174861811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174861811">(Sep 04 2019 at 08:35)</a>:</h4>
<p>Guess it must be due to the rebase or something, I’ll have a look</p>



<a name="174862897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174862897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174862897">(Sep 04 2019 at 08:52)</a>:</h4>
<p>Ah, it was the file where the try blocks cause rustfmt to error out, that explains things</p>



<a name="174862905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/174862905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#174862905">(Sep 04 2019 at 08:53)</a>:</h4>
<p>Anyway, it passes now</p>



<a name="175884134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175884134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175884134">(Sep 17 2019 at 08:00)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> By the way, I plan on eventually following Niko's suggestions and perform a precise analysis on move paths. You mentioned that I could use the rustc unit tests. Do you...err...know how to run those with Polonius? Also, that should probably go in the book at some point, I guess</p>



<a name="175885463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175885463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175885463">(Sep 17 2019 at 08:23)</a>:</h4>
<p>yeah it's the <code>--compare-mode polonius</code> flag to add to your <code>x.py test</code> invocation</p>



<a name="175885552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175885552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175885552">(Sep 17 2019 at 08:25)</a>:</h4>
<p>note that right now there are 2 OOMS, and 4-5 benign failures tho</p>



<a name="175885643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175885643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175885643">(Sep 17 2019 at 08:26)</a>:</h4>
<p>since they're in the run pass maybe <code>--pass check</code> could be helpful in avoiding the OOMs, but I didn't try that (as I had them deleted locally to try to compare durations)</p>



<a name="175902963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175902963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175902963">(Sep 17 2019 at 12:58)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> Thanks, I guess I can just ignore those. Do you know how comprehensive those tests are, otherwise? I.e. how likely are they to catch a subtle mistake?</p>



<a name="175903097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175903097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175903097">(Sep 17 2019 at 13:00)</a>:</h4>
<p>I guess subtlety can be easily missed and it can depend on the specific domain you're testing</p>



<a name="175903120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175903120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175903120">(Sep 17 2019 at 13:00)</a>:</h4>
<p>different areas are more or less well covered</p>



<a name="175903205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175903205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175903205">(Sep 17 2019 at 13:01)</a>:</h4>
<p>say, it'll be better to pass those 10K tests than none at all :)</p>



<a name="175903303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175903303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175903303">(Sep 17 2019 at 13:02)</a>:</h4>
<p>and if the area isn't covered well enough, we can always, and should, add more tests</p>



<a name="175903430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/175903430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#175903430">(Sep 17 2019 at 13:03)</a>:</h4>
<p>in general there are some tests in many areas</p>



<a name="178112121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112121">(Oct 14 2019 at 15:18)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> You mentioned a problem with leapjoins that only filtered, does this happen when you have an expression like:</p>
<div class="codehilite"><pre><span></span>path_definitely_initialized_at(Path, Point) :-
        path_maybe_initialized_on_exit(Path, Point),
        !path_maybe_moved_at(Path, Point).
</pre></div>


<p>Where all components are actually <code>Relation</code>s?</p>



<a name="178112222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112222">(Oct 14 2019 at 15:19)</a>:</h4>
<p>if you're talking about Relation::from_leapjoin or similar I don't know; I only used them with variables</p>



<a name="178112260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112260">(Oct 14 2019 at 15:20)</a>:</h4>
<p>I assume it could apply</p>



<a name="178112291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112291">(Oct 14 2019 at 15:20)</a>:</h4>
<p>Ah, ok. But is it a compilation error or a runtime error?</p>



<a name="178112307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112307">(Oct 14 2019 at 15:20)</a>:</h4>
<p>the WF-ness rule is : "there needs to be an extend_with" (IIRC, surely Frank would know better, but I think it's this)</p>



<a name="178112315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112315">(Oct 14 2019 at 15:20)</a>:</h4>
<p>Ah, ok</p>



<a name="178112316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112316">(Oct 14 2019 at 15:20)</a>:</h4>
<p>runtime error, sometimes</p>



<a name="178112328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112328">(Oct 14 2019 at 15:20)</a>:</h4>
<p>it depends on the data IIRC</p>



<a name="178112332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112332">(Oct 14 2019 at 15:20)</a>:</h4>
<p>Is there an easy work-around?</p>



<a name="178112358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112358">(Oct 14 2019 at 15:21)</a>:</h4>
<p>for variables yes, use a regular join hehe</p>



<a name="178112380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112380">(Oct 14 2019 at 15:21)</a>:</h4>
<p>for relations I don't know sorry, niko added that API but I've never had the opportunity to use it yet</p>



<a name="178112398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112398">(Oct 14 2019 at 15:21)</a>:</h4>
<p>I'll try it and see what happens</p>



<a name="178112484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112484">(Oct 14 2019 at 15:22)</a>:</h4>
<p>My original problem was that I wanted to antijoin on a variable, which you cannot do (I guess because it might lead to future tuples needing to be retracted)</p>



<a name="178112496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112496">(Oct 14 2019 at 15:22)</a>:</h4>
<p>So I had to stage my computation</p>



<a name="178112508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112508">(Oct 14 2019 at 15:22)</a>:</h4>
<p>Which means that in the end, all I really have are Relations</p>



<a name="178112533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112533">(Oct 14 2019 at 15:23)</a>:</h4>
<p>not even one variable ?</p>



<a name="178112537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112537">(Oct 14 2019 at 15:23)</a>:</h4>
<p>Nope</p>



<a name="178112571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112571">(Oct 14 2019 at 15:23)</a>:</h4>
<p>maybe you can then artificially make one variable</p>



<a name="178112579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112579">(Oct 14 2019 at 15:23)</a>:</h4>
<p>I guess I can</p>



<a name="178112590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112590">(Oct 14 2019 at 15:24)</a>:</h4>
<p>It works as a quick work-around :)</p>



<a name="178112646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112646">(Oct 14 2019 at 15:24)</a>:</h4>
<p>what relation are you producing ?</p>



<a name="178112710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112710">(Oct 14 2019 at 15:25)</a>:</h4>
<p>So it's a four-stage process: first I compute transitive closure of path accesses, then I use those to compute paths that may be moved or not moved, then I calculate the definitely-moved ones and I use those to generate move errors</p>



<a name="178112731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112731">(Oct 14 2019 at 15:25)</a>:</h4>
<p>Basically, move errors = path access - known initialised paths</p>



<a name="178112734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112734">(Oct 14 2019 at 15:25)</a>:</h4>
<p>seems like move errors are an intensional predicate</p>



<a name="178112800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112800">(Oct 14 2019 at 15:26)</a>:</h4>
<p>known initialised paths = maybe initialised paths - maybe moved paths</p>



<a name="178112805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112805">(Oct 14 2019 at 15:26)</a>:</h4>
<p>err maybe?</p>



<a name="178112815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112815">(Oct 14 2019 at 15:26)</a>:</h4>
<p>(what does that mean?)</p>



<a name="178112862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112862">(Oct 14 2019 at 15:27)</a>:</h4>
<p>it's producing tuples, not input data; those are usually variables, except for your stratification problem as you mentioned, there you had no choice</p>



<a name="178112897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178112897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178112897">(Oct 14 2019 at 15:27)</a>:</h4>
<p>Ah, ok, yes</p>



<a name="178113024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178113024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178113024">(Oct 14 2019 at 15:29)</a>:</h4>
<p>but yeah if stratification is turning every join into a separate iteration, that's unfortunate</p>



<a name="178113054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178113054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178113054">(Oct 14 2019 at 15:29)</a>:</h4>
<p>and here a couple variables at the last step should unblock you</p>



<a name="178113235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178113235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178113235">(Oct 14 2019 at 15:31)</a>:</h4>
<p>Yes, thanks!</p>



<a name="178116111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178116111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178116111">(Oct 14 2019 at 16:07)</a>:</h4>
<p>Ok, revamped initialisation logic compiling now :)</p>



<a name="178116131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178116131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178116131">(Oct 14 2019 at 16:07)</a>:</h4>
<p>Let's see if it messed up any ui-tests first, and <em>then</em> worry about how to verify move errors</p>



<a name="178129864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178129864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178129864">(Oct 14 2019 at 19:11)</a>:</h4>
<p>This looks...slightly promising? I can't see how these failures would be due to initialisation:</p>
<div class="codehilite"><pre><span></span>failures:
    [ui] ui/abi/cross-crate/anon-extern-mod-cross-crate-2.rs
    [ui] ui/abi/duplicated-external-mods.rs
    [ui] ui/abi/extern/extern-crosscrate.rs
    [ui] ui/abi/foreign/foreign-dupe.rs
    [ui] ui/abi/invoke-external-foreign.rs
</pre></div>



<a name="178129937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178129937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178129937">(Oct 14 2019 at 19:12)</a>:</h4>
<p>All the errors are from <code>ld</code></p>



<a name="178182474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178182474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178182474">(Oct 15 2019 at 11:17)</a>:</h4>
<p>Hmm, difficult to say if I changed anything: literally stopping all generation of <code>child</code> in Rust gives me no additional errors, so either I'm doing something wrong or it doesn't cover move paths x drop-liveness very much</p>



<a name="178183773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178183773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178183773">(Oct 15 2019 at 11:35)</a>:</h4>
<p>what kind of errors are you expecting and where ?</p>



<a name="178188724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178188724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178188724">(Oct 15 2019 at 12:42)</a>:</h4>
<p>That is a good question. So what I did was I stopped emitting <code>child</code> at all, which would mean that nothing would be drop-live, so I would expect Polonius to under-report some errors with structs implementing their own drop if they hold a loan that is violated.</p>



<a name="178188763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178188763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178188763">(Oct 15 2019 at 12:43)</a>:</h4>
<p>I know I lifted some examples from the compiletests into Polonius inputs, and those should at least cause problems</p>



<a name="178188865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178188865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178188865">(Oct 15 2019 at 12:44)</a>:</h4>
<p>...ok no I get it it shouldn't cause a problem</p>



<a name="178188902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178188902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178188902">(Oct 15 2019 at 12:44)</a>:</h4>
<p>...because initialisation is always precise enough I think, or at least it is in the example I am thinking of</p>



<a name="178189850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/178189850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#178189850">(Oct 15 2019 at 12:56)</a>:</h4>
<p>Anyway, the shared context stuff would have been nice now, because then I could use it to report errors from the initialisation step :)</p>



<a name="181097772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181097772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181097772">(Nov 19 2019 at 10:19)</a>:</h4>
<p>(deleted)</p>



<a name="181097782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181097782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181097782">(Nov 19 2019 at 10:19)</a>:</h4>
<p>(deleted)</p>



<a name="181105821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181105821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181105821">(Nov 19 2019 at 12:20)</a>:</h4>
<p>Ok, so the move error code is...not correct</p>



<a name="181105828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181105828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181105828">(Nov 19 2019 at 12:20)</a>:</h4>
<p>Precisely how, I don't know yet</p>



<a name="181106287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181106287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181106287">(Nov 19 2019 at 12:28)</a>:</h4>
<p>It is also INCREDIBLY slow on clap</p>



<a name="181106538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181106538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181106538">(Nov 19 2019 at 12:33)</a>:</h4>
<p>Ah, it's at least one fact generation bug, I generate <code>path_accessed_at()</code> events at midpoint, should be start-point</p>



<a name="181112468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181112468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181112468">(Nov 19 2019 at 13:54)</a>:</h4>
<p>Update: I think it's...working after fixing that. I mean, I'm sure there might be edge cases, but it's working for the simple cases I have tried so far.</p>



<a name="181112939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181112939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181112939">(Nov 19 2019 at 14:00)</a>:</h4>
<p>Hey all, be here soon</p>



<a name="181112953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181112953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181112953">(Nov 19 2019 at 14:00)</a>:</h4>
<p>Me too, I'm getting some tea</p>



<a name="181113347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181113347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181113347">(Nov 19 2019 at 14:05)</a>:</h4>
<p>OK</p>



<a name="181113452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181113452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181113452">(Nov 19 2019 at 14:07)</a>:</h4>
<p>So <span class="user-mention" data-user-id="204115">@Albin Stjerna</span> where we at here :)</p>



<a name="181113577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181113577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181113577">(Nov 19 2019 at 14:08)</a>:</h4>
<p>PS I prob have to go in ~3hr, at least for a bit</p>



<a name="181114201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114201">(Nov 19 2019 at 14:15)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> one thing I wanted to do is to update the <a href="https://hackmd.io/CGMNjt1hR_qYtsR9hgdGmw" target="_blank" title="https://hackmd.io/CGMNjt1hR_qYtsR9hgdGmw">"canonical polonius rules"</a> to include the rules for initialization and liveness</p>



<a name="181114206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114206">(Nov 19 2019 at 14:16)</a>:</h4>
<blockquote>
<p>PS I prob have to go in ~3hr, at least for a bit</p>
</blockquote>
<p>Fine by me, I'd like to go home around then</p>



<a name="181114283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114283">(Nov 19 2019 at 14:16)</a>:</h4>
<p>That means we have to argue about the names of everything :)</p>



<a name="181114294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114294">(Nov 19 2019 at 14:16)</a>:</h4>
<p>lol</p>



<a name="181114299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114299">(Nov 19 2019 at 14:17)</a>:</h4>
<p>well let's start with whatever names :)</p>



<a name="181114311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114311">(Nov 19 2019 at 14:17)</a>:</h4>
<p>first off, I guess, I should start by looking at your PR?</p>



<a name="181114317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114317">(Nov 19 2019 at 14:17)</a>:</h4>
<p>I guess!</p>



<a name="181114343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114343">(Nov 19 2019 at 14:17)</a>:</h4>
<p>I have restructured the code a bit so that the passes are clearer</p>



<a name="181114367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114367">(Nov 19 2019 at 14:17)</a>:</h4>
<p>I also think the passes are probably a bad idea and we should think about a better way to do them</p>



<a name="181114435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114435">(Nov 19 2019 at 14:18)</a>:</h4>
<p>But it's not a gigantonormous function anymore</p>



<a name="181114681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181114681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181114681">(Nov 19 2019 at 14:20)</a>:</h4>
<p>I'll update the hackmd while you are looking :)</p>



<a name="181115068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115068">(Nov 19 2019 at 14:24)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> maybe we can do that a bit together?</p>



<a name="181115070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115070">(Nov 19 2019 at 14:24)</a>:</h4>
<p>I'm reading now</p>



<a name="181115080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115080">(Nov 19 2019 at 14:24)</a>:</h4>
<p>Sure!</p>



<a name="181115093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115093">(Nov 19 2019 at 14:24)</a>:</h4>
<p>to start, what are the fresh inputs</p>



<a name="181115128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115128">(Nov 19 2019 at 14:25)</a>:</h4>
<p>I guess some of that is already present in the code</p>



<a name="181115141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115141">(Nov 19 2019 at 14:25)</a>:</h4>
<p>Well, there are no new inputs since my last PR</p>



<a name="181115199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115199">(Nov 19 2019 at 14:25)</a>:</h4>
<p>right so we should look at the <a href="https://github.com/rust-lang/polonius/blob/90a08116c1b1f43f6ea1f08045f31a9a875b4529/polonius-engine/src/facts.rs" target="_blank" title="https://github.com/rust-lang/polonius/blob/90a08116c1b1f43f6ea1f08045f31a9a875b4529/polonius-engine/src/facts.rs">facts.rs</a></p>



<a name="181115331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115331">(Nov 19 2019 at 14:26)</a>:</h4>
<p>I can do better <a href="/user_uploads/4715/OTt_X5ILh4Ap90BvEAgvNA44/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/OTt_X5ILh4Ap90BvEAgvNA44/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/OTt_X5ILh4Ap90BvEAgvNA44/pasted_image.png"></a></div>



<a name="181115396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115396">(Nov 19 2019 at 14:27)</a>:</h4>
<p><a href="/user_uploads/4715/jqJj0V1uS473IoruhnyQ7REd/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/jqJj0V1uS473IoruhnyQ7REd/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/jqJj0V1uS473IoruhnyQ7REd/pasted_image.png"></a></div>



<a name="181115431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115431">(Nov 19 2019 at 14:27)</a>:</h4>
<blockquote>
<p>dramatis personae </p>
</blockquote>
<p><span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span> :)</p>



<a name="181115500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115500">(Nov 19 2019 at 14:28)</a>:</h4>
<p>If you liked that, you should see my Hamlet quotes at the start of every chapter</p>



<a name="181115515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115515">(Nov 19 2019 at 14:28)</a>:</h4>
<p>I mean, I spent a <em>lot</em> of time rewriting that thing, I might as well get to be a bit silly</p>



<a name="181115531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115531">(Nov 19 2019 at 14:28)</a>:</h4>
<p>I'll be looking forward to your updated manuscript :)</p>



<a name="181115577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115577">(Nov 19 2019 at 14:29)</a>:</h4>
<p>here's a spoiler: <a href="/user_uploads/4715/MsjOVv961XI6_IbR87cZnUak/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/MsjOVv961XI6_IbR87cZnUak/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/MsjOVv961XI6_IbR87cZnUak/pasted_image.png"></a></div>



<a name="181115586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115586">(Nov 19 2019 at 14:29)</a>:</h4>
<p>nice</p>



<a name="181115610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115610">(Nov 19 2019 at 14:29)</a>:</h4>
<p>I also have examples for every slightly complex rule</p>



<a name="181115618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115618">(Nov 19 2019 at 14:29)</a>:</h4>
<p>nice :)</p>



<a name="181115625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115625">(Nov 19 2019 at 14:29)</a>:</h4>
<p>I wrote those specifically with the idea of porting them to The Book</p>



<a name="181115638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115638">(Nov 19 2019 at 14:30)</a>:</h4>
<p>beautiful</p>



<a name="181115681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115681">(Nov 19 2019 at 14:30)</a>:</h4>
<p>ok, so, I am copying some of that over</p>



<a name="181115697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115697">(Nov 19 2019 at 14:30)</a>:</h4>
<p>I added a section 'liveness-related inputs'</p>



<a name="181115703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115703">(Nov 19 2019 at 14:30)</a>:</h4>
<p>(I let everyone know you were re-working your draft btw <a href="https://rust-lang.github.io/compiler-team/minutes/triage-meeting/2019-11-14/" target="_blank" title="https://rust-lang.github.io/compiler-team/minutes/triage-meeting/2019-11-14/">https://rust-lang.github.io/compiler-team/minutes/triage-meeting/2019-11-14/</a> :) (Working group sync a bit down)</p>



<a name="181115736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115736">(Nov 19 2019 at 14:30)</a>:</h4>
<p>can you say a bit about <code>var_initialized_on_entry</code></p>



<a name="181115751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115751">(Nov 19 2019 at 14:31)</a>:</h4>
<p>Ok, so it solves an off-by-one problem</p>



<a name="181115766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115766">(Nov 19 2019 at 14:31)</a>:</h4>
<p>is that <code>initialized_at</code> from the code?</p>



<a name="181115790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115790">(Nov 19 2019 at 14:31)</a>:</h4>
<p>Not really</p>



<a name="181115814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115814">(Nov 19 2019 at 14:31)</a>:</h4>
<p>initialized_at says that something becomes initialised at mid-point of somewhere</p>



<a name="181115891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115891">(Nov 19 2019 at 14:32)</a>:</h4>
<p>var_initialized_on_exit is the "propagated" version of that; it moves across the CFG as you would expect</p>



<a name="181115901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115901">(Nov 19 2019 at 14:32)</a>:</h4>
<p>but it stops at a move</p>



<a name="181115926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115926">(Nov 19 2019 at 14:32)</a>:</h4>
<p>Which means that <em>every</em> move would have a move error (I think)</p>



<a name="181115996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181115996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181115996">(Nov 19 2019 at 14:33)</a>:</h4>
<p>So what it says intuitively is that if we know that a move is initialized on exit from somewhere, we also know that it's initialized when arriving at the successor (but not necessarily when leaving it)</p>



<a name="181116007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116007">(Nov 19 2019 at 14:33)</a>:</h4>
<blockquote>
<p>var_initialized_on_exit is the "propagated" version of that; it moves across the CFG as you would expect</p>
</blockquote>
<p>two questions</p>



<a name="181116056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116056">(Nov 19 2019 at 14:34)</a>:</h4>
<p>first, the image above says <code>var_initialized_on_*entry*</code></p>



<a name="181116065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116065">(Nov 19 2019 at 14:34)</a>:</h4>
<p>second, it says it's a "fact"</p>



<a name="181116120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116120">(Nov 19 2019 at 14:34)</a>:</h4>
<p>There's two of them, and they are facts from the perspective of liveness</p>



<a name="181116147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116147">(Nov 19 2019 at 14:35)</a>:</h4>
<p>I see</p>



<a name="181116161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116161">(Nov 19 2019 at 14:35)</a>:</h4>
<p>I'm kind of fudging it in the table</p>



<a name="181116186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116186">(Nov 19 2019 at 14:35)</a>:</h4>
<p>I hadn't thought about the question of distinct "phases"</p>



<a name="181116302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116302">(Nov 19 2019 at 14:36)</a>:</h4>
<p>I guess it makes sense to start with the <em>move</em> stuff? (that is kind of the first phase?)</p>



<a name="181116318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116318">(Nov 19 2019 at 14:36)</a>:</h4>
<p>I guess, yes</p>



<a name="181116334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116334">(Nov 19 2019 at 14:36)</a>:</h4>
<p>I mean, the move analysis forks</p>



<a name="181116345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116345">(Nov 19 2019 at 14:36)</a>:</h4>
<p>One part goes into liveness, and the other continues to become move errors</p>



<a name="181116386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116386">(Nov 19 2019 at 14:37)</a>:</h4>
<p>But computationally the move analysis happens first :)</p>



<a name="181116393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116393">(Nov 19 2019 at 14:37)</a>:</h4>
<p>I really should just down your thesis right now, shouldn't I</p>



<a name="181116479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116479">(Nov 19 2019 at 14:38)</a>:</h4>
<p>It might be the fastest way to understand what I'm doing yes</p>



<a name="181116489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116489">(Nov 19 2019 at 14:38)</a>:</h4>
<p>But don't read the old one</p>



<a name="181116524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116524">(Nov 19 2019 at 14:38)</a>:</h4>
<p>send me the correct link</p>



<a name="181116544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116544">(Nov 19 2019 at 14:38)</a>:</h4>
<p>let's dial back a bit</p>



<a name="181116551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116551">(Nov 19 2019 at 14:38)</a>:</h4>
<p><a href="/user_uploads/4715/wo3Mo_EQ9MKiWGbd2qI-sMn4/Thesis.pdf" target="_blank" title="Thesis.pdf">here's the newest draft</a></p>



<a name="181116558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116558">(Nov 19 2019 at 14:38)</a>:</h4>
<p>I'm thinking that a flat hackmd with "all the rules" is probably not best</p>



<a name="181116570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116570">(Nov 19 2019 at 14:38)</a>:</h4>
<p>let's start by writing out the overall flow</p>



<a name="181116737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116737">(Nov 19 2019 at 14:40)</a>:</h4>
<p>I'm guessing that's in the thesis</p>



<a name="181116747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116747">(Nov 19 2019 at 14:40)</a>:</h4>
<p>I have these, which are less accurate now:<br>
<a href="/user_uploads/4715/UKWkcn0bUv-gZET7CMLLYfMP/pasted_image.png" target="_blank" title="pasted_image.png">Very high</a> <a href="/user_uploads/4715/Jz4YtpOC9RSQ9XHc-nK9Q6Z9/pasted_image.png" target="_blank" title="pasted_image.png">Slightly lower</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/UKWkcn0bUv-gZET7CMLLYfMP/pasted_image.png" target="_blank" title="Very high"><img src="/user_uploads/4715/UKWkcn0bUv-gZET7CMLLYfMP/pasted_image.png"></a></div><div class="message_inline_image"><a href="/user_uploads/4715/Jz4YtpOC9RSQ9XHc-nK9Q6Z9/pasted_image.png" target="_blank" title="Slightly lower"><img src="/user_uploads/4715/Jz4YtpOC9RSQ9XHc-nK9Q6Z9/pasted_image.png"></a></div>



<a name="181116763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116763">(Nov 19 2019 at 14:40)</a>:</h4>
<p>(move errors are kind of a happy bonus)</p>



<a name="181116765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116765">(Nov 19 2019 at 14:40)</a>:</h4>
<p>heh, just found those</p>



<a name="181116848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116848">(Nov 19 2019 at 14:41)</a>:</h4>
<p>(this is really quite beautifully done)</p>



<a name="181116867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116867">(Nov 19 2019 at 14:41)</a>:</h4>
<p>Thank you!</p>



<a name="181116966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181116966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181116966">(Nov 19 2019 at 14:42)</a>:</h4>
<p>I really needed to hear that, given that I had literally no input for months, then got "ok but this is incomprehensible" as feedback from my subject reviewer, then spent almost two months' of evenings and weekends rewriting it into this</p>



<a name="181117003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117003">(Nov 19 2019 at 14:43)</a>:</h4>
<p>It wasn't all bad though because I didn't like the first version, and I do like this one</p>



<a name="181117031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117031">(Nov 19 2019 at 14:43)</a>:</h4>
<p>And as I said, it should be straightforward to cannibalise it into the book</p>



<a name="181117205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117205">(Nov 19 2019 at 14:45)</a>:</h4>
<p>sorry for not giving you more feedback earlier :)</p>



<a name="181117212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117212">(Nov 19 2019 at 14:45)</a>:</h4>
<p>anyway, I think the "big picture" is this:</p>



<a name="181117224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117224">(Nov 19 2019 at 14:45)</a>:</h4>
<p>It's all right, I'm blaming Tobias more than you :)</p>



<a name="181117233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117233">(Nov 19 2019 at 14:45)</a>:</h4>
<p>me too :P</p>



<a name="181117253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117253">(Nov 19 2019 at 14:45)</a>:</h4>
<ul>
<li>
<p>Initialization analysis<br>
    * computes which Paths are initialized at each cfg node<br>
    * reports errors for things that are used when not necessarily initialized</p>
</li>
<li>
<p>Liveness analysis<br>
    * computes which variables may be used in the future at each cfg node, and how<br>
    * this in turn suggests which <em>origins</em> are 'live' (meaning that they may be dereferenced)</p>
</li>
<li>
<p>Origin analysis<br>
    * computes which loans may be referenced by each origin<br>
    * this in turn suggests which <em>loans</em> are 'live' (meaning that references resulting from them may be dereferenced)</p>
</li>
</ul>



<a name="181117329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117329">(Nov 19 2019 at 14:46)</a>:</h4>
<p>(I have to find a better phrasing for the last part, since it doesn't account for 'killed' loans, but anyway)</p>



<a name="181117432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117432">(Nov 19 2019 at 14:47)</a>:</h4>
<p>oh and I forgot to add that liveness uses initialization to make its results more precise</p>



<a name="181117453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117453">(Nov 19 2019 at 14:47)</a>:</h4>
<p>I think it would be incorrect without it, but yes</p>



<a name="181117602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117602">(Nov 19 2019 at 14:48)</a>:</h4>
<p>so in terms of your PR btw</p>



<a name="181117621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117621">(Nov 19 2019 at 14:49)</a>:</h4>
<p>it's useful for me to pull this stuff together, but what do you see as the actual bits of coding needed before it can land?</p>



<a name="181117645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117645">(Nov 19 2019 at 14:49)</a>:</h4>
<p>It took me a long time to realise that conceptually it's not that a drop of something moved is a no-op, it's not even the responsibility of that drop, given that the object has been moved to somewhere else (which should drop it).</p>



<a name="181117660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117660">(Nov 19 2019 at 14:49)</a>:</h4>
<p>Hmm, I would need to change some things in rustc</p>



<a name="181117669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117669">(Nov 19 2019 at 14:49)</a>:</h4>
<p>Notably, I need to emit accessed_at() at start and not mid-point</p>



<a name="181117683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117683">(Nov 19 2019 at 14:49)</a>:</h4>
<p>Also make child() non-transitive</p>



<a name="181117689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117689">(Nov 19 2019 at 14:50)</a>:</h4>
<p>(not required, but reasonable)</p>



<a name="181117771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117771">(Nov 19 2019 at 14:50)</a>:</h4>
<p>And perhaps rename path_belongs_to_var to something like path_starts_in_var</p>



<a name="181117785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117785">(Nov 19 2019 at 14:50)</a>:</h4>
<p>(I'm skimming the code in the PR itself, which so far seems very good)</p>



<a name="181117824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117824">(Nov 19 2019 at 14:51)</a>:</h4>
<p>Also, I do we want to use Hungarian notation and have _var pre- and suffixes?</p>



<a name="181117890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117890">(Nov 19 2019 at 14:52)</a>:</h4>
<p>I think we should rename <code>child</code> to <code>parent</code></p>



<a name="181117940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117940">(Nov 19 2019 at 14:52)</a>:</h4>
<p>for consistency with <code>ancestor</code></p>



<a name="181117942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117942">(Nov 19 2019 at 14:52)</a>:</h4>
<p>(side note)</p>



<a name="181117961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117961">(Nov 19 2019 at 14:52)</a>:</h4>
<p>Hm, yes, I have both, but I need to index it from the left</p>



<a name="181117966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117966">(Nov 19 2019 at 14:52)</a>:</h4>
<p>Or at some point I had both anyway</p>



<a name="181117979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181117979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181117979">(Nov 19 2019 at 14:52)</a>:</h4>
<blockquote>
<p>Also, I do we want to use Hungarian notation and have _var pre- and suffixes?</p>
</blockquote>
<p>I don't quite follow this</p>



<a name="181118004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118004">(Nov 19 2019 at 14:52)</a>:</h4>
<p>Ok so many but not all relations follow a convention where they record what they are relations between</p>



<a name="181118020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118020">(Nov 19 2019 at 14:53)</a>:</h4>
<p>For example <code>var_uses_region</code></p>



<a name="181118034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118034">(Nov 19 2019 at 14:53)</a>:</h4>
<p>(Which I guess is now called something else)</p>



<a name="181118070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118070">(Nov 19 2019 at 14:53)</a>:</h4>
<p>Given that we typically know the type of the relations, <code>var</code> and <code>region</code> are sort of redundant, right?</p>



<a name="181118073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118073">(Nov 19 2019 at 14:53)</a>:</h4>
<p>Also, we are inconsistent with this</p>



<a name="181118119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118119">(Nov 19 2019 at 14:54)</a>:</h4>
<p>We are also inconsistent with the <code>_at</code> suffix</p>



<a name="181118351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118351">(Nov 19 2019 at 14:56)</a>:</h4>
<p>good video on the topic (which kinda disagrees with the premise that knowing the types of the arguments is <em>always</em> redundant to the relation name) <a href="https://www.youtube.com/watch?v=Uska9DgJEoo" target="_blank" title="https://www.youtube.com/watch?v=Uska9DgJEoo">https://www.youtube.com/watch?v=Uska9DgJEoo</a></p>
<div class="youtube-video message_inline_image"><a data-id="Uska9DgJEoo" href="https://www.youtube.com/watch?v=Uska9DgJEoo" target="_blank" title="https://www.youtube.com/watch?v=Uska9DgJEoo"><img src="https://i.ytimg.com/vi/Uska9DgJEoo/default.jpg"></a></div>



<a name="181118418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118418">(Nov 19 2019 at 14:56)</a>:</h4>
<p>I agree we are somewhat inconsistent :)</p>



<a name="181118470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118470">(Nov 19 2019 at 14:57)</a>:</h4>
<p>I don't feel the need to record 100% of the types</p>



<a name="181118482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118482">(Nov 19 2019 at 14:57)</a>:</h4>
<p>in the name</p>



<a name="181118499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118499">(Nov 19 2019 at 14:57)</a>:</h4>
<p>and I definitely don't want to go full-on <code>pn_moved_out</code> or something</p>



<a name="181118521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118521">(Nov 19 2019 at 14:57)</a>:</h4>
<p>but I do find that having some redundancy helps me when reading</p>



<a name="181118538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118538">(Nov 19 2019 at 14:57)</a>:</h4>
<p>I view the types in the declarations as being for the compiler</p>



<a name="181118550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118550">(Nov 19 2019 at 14:57)</a>:</h4>
<p>and the types in the names as being for the reader</p>



<a name="181118618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118618">(Nov 19 2019 at 14:58)</a>:</h4>
<p>but e.g. <code>moved_out_at(Path, Node)</code> .. hmm .. <code>path_moved_out_at(Path, Node)</code> feels like an improvement, likely</p>



<a name="181118628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118628">(Nov 19 2019 at 14:58)</a>:</h4>
<p><code>path_moved_out_at_node</code>, not sure :)</p>



<a name="181118664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118664">(Nov 19 2019 at 14:58)</a>:</h4>
<p>I definitely like the ordering of the arguments to "match" the name somehow</p>



<a name="181118684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118684">(Nov 19 2019 at 14:59)</a>:</h4>
<p>maybe just writing everything out would feel better?</p>



<a name="181118705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118705">(Nov 19 2019 at 14:59)</a>:</h4>
<p>I'm thinking about e.g. <code>contains</code> -- something like <code>origin_contains_loan</code>... probably clearer ..</p>



<a name="181118814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118814">(Nov 19 2019 at 15:00)</a>:</h4>
<p>on the other hand I was pretty happy with <code>placeholder(Origin, Loan)</code></p>



<a name="181118829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118829">(Nov 19 2019 at 15:00)</a>:</h4>
<p>and I cannot imagine that "hungarian style notation" would improve that</p>



<a name="181118840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181118840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181118840">(Nov 19 2019 at 15:00)</a>:</h4>
<p>(it's not a verb, I guess)</p>



<a name="181119007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119007">(Nov 19 2019 at 15:02)</a>:</h4>
<p>the other thing we sometimes have to record if <code>foo_base</code> vs <code>foo</code> (transitive)</p>



<a name="181119242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119242">(Nov 19 2019 at 15:04)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> some other inconsistencies, which seem perhaps more imporant:</p>
<ul>
<li><code>moved_out_at</code> -- a move occurred at this point</li>
<li><code>path_maybe_moved_at</code> -- the path may have been moved some time before this point</li>
</ul>



<a name="181119276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119276">(Nov 19 2019 at 15:05)</a>:</h4>
<p>Hmm</p>



<a name="181119284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119284">(Nov 19 2019 at 15:05)</a>:</h4>
<p>seems related to transitive vs direct</p>



<a name="181119305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119305">(Nov 19 2019 at 15:05)</a>:</h4>
<p>maybe best answered by just not using the term "moved" for both</p>



<a name="181119388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119388">(Nov 19 2019 at 15:06)</a>:</h4>
<p>I guess that is <code>path_maybe_uninitialized_on_entry</code>?</p>



<a name="181119413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119413">(Nov 19 2019 at 15:06)</a>:</h4>
<p>Hm, yes, I guess so</p>



<a name="181119447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119447">(Nov 19 2019 at 15:06)</a>:</h4>
<p>These include/exclude things are <em>really</em> tricky</p>



<a name="181119873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119873">(Nov 19 2019 at 15:10)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> so <code>var_maybe_initialized_on_exit</code></p>



<a name="181119882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119882">(Nov 19 2019 at 15:11)</a>:</h4>
<p>this is specifically concluding: is there <em>any</em> subpath  of the variable that is initialized</p>



<a name="181119896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119896">(Nov 19 2019 at 15:11)</a>:</h4>
<p>It used to be that</p>



<a name="181119904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119904">(Nov 19 2019 at 15:11)</a>:</h4>
<p>hmm</p>



<a name="181119907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119907">(Nov 19 2019 at 15:11)</a>:</h4>
<p>It's not anymore</p>



<a name="181119912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119912">(Nov 19 2019 at 15:11)</a>:</h4>
<p>It's the opposite</p>



<a name="181119935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119935">(Nov 19 2019 at 15:11)</a>:</h4>
<p>It specifically tracks if the <em>root path</em> of <code>x</code> was moved</p>



<a name="181119957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119957">(Nov 19 2019 at 15:11)</a>:</h4>
<p>I guess the question is what this input means</p>



<a name="181119965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181119965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181119965">(Nov 19 2019 at 15:12)</a>:</h4>
<div class="codehilite"><pre><span></span>path_belongs_to_var
</pre></div>



<a name="181120022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120022">(Nov 19 2019 at 15:12)</a>:</h4>
<p>You asked when I introduced it and you were right</p>



<a name="181120062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120062">(Nov 19 2019 at 15:12)</a>:</h4>
<p>I want to change it to <code>path_is_root_of_var</code> or something like that</p>



<a name="181120071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120071">(Nov 19 2019 at 15:12)</a>:</h4>
<p>I think is should just be</p>



<a name="181120074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120074">(Nov 19 2019 at 15:12)</a>:</h4>
<p><code>path_is_var</code></p>



<a name="181120084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120084">(Nov 19 2019 at 15:13)</a>:</h4>
<p>...yes, that works better</p>



<a name="181120116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120116">(Nov 19 2019 at 15:13)</a>:</h4>
<p>It's what we want for drop-liveness anyway, right?</p>



<a name="181120122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120122">(Nov 19 2019 at 15:13)</a>:</h4>
<p>Because we only care about full moves</p>



<a name="181120175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120175">(Nov 19 2019 at 15:13)</a>:</h4>
<p>Given that the drop() override is attached to whatever was rooted at that variable</p>



<a name="181120232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120232">(Nov 19 2019 at 15:14)</a>:</h4>
<p>well that was the next question</p>



<a name="181120239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120239">(Nov 19 2019 at 15:14)</a>:</h4>
<p>I mean if the variable is <em>partly</em> initialized</p>



<a name="181120260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120260">(Nov 19 2019 at 15:14)</a>:</h4>
<p>we still have to drop those parts that remain</p>



<a name="181120271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120271">(Nov 19 2019 at 15:14)</a>:</h4>
<p>I guess I'll check it out when I get that far</p>



<a name="181120279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120279">(Nov 19 2019 at 15:14)</a>:</h4>
<p>ps I've been editing the hackmd</p>



<a name="181120284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120284">(Nov 19 2019 at 15:14)</a>:</h4>
<p>I see that</p>



<a name="181120287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120287">(Nov 19 2019 at 15:14)</a>:</h4>
<p>not sure if you're following along at all</p>



<a name="181120288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120288">(Nov 19 2019 at 15:14)</a>:</h4>
<p>ok</p>



<a name="181120290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120290">(Nov 19 2019 at 15:14)</a>:</h4>
<p>I am!</p>



<a name="181120294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120294">(Nov 19 2019 at 15:14)</a>:</h4>
<p>...sort of</p>



<a name="181120296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120296">(Nov 19 2019 at 15:14)</a>:</h4>
<p>I'm doing some on the fly renaming :P</p>



<a name="181120318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120318">(Nov 19 2019 at 15:15)</a>:</h4>
<p>...ok not sufficiently</p>



<a name="181120320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120320">(Nov 19 2019 at 15:15)</a>:</h4>
<p>I think we should start documenting conventions at the top maybe</p>



<a name="181120329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120329">(Nov 19 2019 at 15:15)</a>:</h4>
<p>YES</p>



<a name="181120432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120432">(Nov 19 2019 at 15:16)</a>:</h4>
<p>hmm, wait</p>



<a name="181120454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120454">(Nov 19 2019 at 15:16)</a>:</h4>
<p>I'm taking a stab at some, feel free to tell me that they are bad :)</p>



<a name="181120462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120462">(Nov 19 2019 at 15:16)</a>:</h4>
<p>There was a reason why <code>paty_maybe_moved_...</code> was called that</p>



<a name="181120469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120469">(Nov 19 2019 at 15:16)</a>:</h4>
<p>(I think we're not consistently following them yet)</p>



<a name="181120489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120489">(Nov 19 2019 at 15:16)</a>:</h4>
<blockquote>
<p>There was a reason why <code>paty_maybe_moved_...</code> was called that</p>
</blockquote>
<p>what was that</p>



<a name="181120493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120493">(Nov 19 2019 at 15:16)</a>:</h4>
<p>Uninitialised should be <em>de</em>initialised</p>



<a name="181120508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120508">(Nov 19 2019 at 15:16)</a>:</h4>
<p>ah, interesting</p>



<a name="181120511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120511">(Nov 19 2019 at 15:16)</a>:</h4>
<p>Because this relation does <em>not</em> capture a variable that has never been initialised</p>



<a name="181120523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120523">(Nov 19 2019 at 15:17)</a>:</h4>
<p>Ok, +1 to deinitialized</p>



<a name="181120531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120531">(Nov 19 2019 at 15:17)</a>:</h4>
<p>that said</p>



<a name="181120532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120532">(Nov 19 2019 at 15:17)</a>:</h4>
<p>That would have required starting at the root of the CFG, which I did not have</p>



<a name="181120549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120549">(Nov 19 2019 at 15:17)</a>:</h4>
<p>I just proposed the convention of <code>on_entry</code> vs <code>at</code> to distinguish "instantaneous" things from "over path" things</p>



<a name="181120570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120570">(Nov 19 2019 at 15:17)</a>:</h4>
<p>Ok, sounds reasonable</p>



<a name="181120575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120575">(Nov 19 2019 at 15:17)</a>:</h4>
<p>so we could maybe just use <code>moved</code></p>



<a name="181120611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120611">(Nov 19 2019 at 15:18)</a>:</h4>
<p>though I sort of like the idea of also trying to separate out the property</p>



<a name="181120657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120657">(Nov 19 2019 at 15:18)</a>:</h4>
<p>e.g., <code>initialized_at</code> vs <code>initialized_on_entry</code></p>



<a name="181120666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120666">(Nov 19 2019 at 15:18)</a>:</h4>
<p>we would need a different name for the former otherwise, which is maybe ok ("assigned"?)</p>



<a name="181120677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120677">(Nov 19 2019 at 15:18)</a>:</h4>
<p>ok so <code>at</code> would be my <code>on exit</code>?</p>



<a name="181120701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120701">(Nov 19 2019 at 15:18)</a>:</h4>
<p>well I mean we have <code>initialized_at</code> which is an input fact, right?</p>



<a name="181120711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120711">(Nov 19 2019 at 15:18)</a>:</h4>
<p>Aah ok you meant like that</p>



<a name="181120713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120713">(Nov 19 2019 at 15:18)</a>:</h4>
<p>that just says "there is an initialization at this point"</p>



<a name="181120723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120723">(Nov 19 2019 at 15:18)</a>:</h4>
<p>Ok that makes sense</p>



<a name="181120788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120788">(Nov 19 2019 at 15:19)</a>:</h4>
<p>So any input fact would be <code>_at</code>, and the computed relations would be <code>_on_entry</code> or <code>on_exit</code></p>



<a name="181120794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120794">(Nov 19 2019 at 15:19)</a>:</h4>
<p>Makes sense!</p>



<a name="181120857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120857">(Nov 19 2019 at 15:20)</a>:</h4>
<p>but shall we also try to have distinct "relation names"?</p>



<a name="181120872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120872">(Nov 19 2019 at 15:20)</a>:</h4>
<p>I just updated to <code>assigned_at</code> for example and I think it's useful</p>



<a name="181120877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120877">(Nov 19 2019 at 15:20)</a>:</h4>
<p>redundancy ftw</p>



<a name="181120882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120882">(Nov 19 2019 at 15:20)</a>:</h4>
<p>You mean from facts? I guess it makes sense too</p>



<a name="181120991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120991">(Nov 19 2019 at 15:21)</a>:</h4>
<p>yeah, I am doing that</p>



<a name="181120996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181120996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181120996">(Nov 19 2019 at 15:21)</a>:</h4>
<p>which suggests "deinitialized"</p>



<a name="181121019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121019">(Nov 19 2019 at 15:21)</a>:</h4>
<p>that's ok I think?</p>



<a name="181121025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121025">(Nov 19 2019 at 15:21)</a>:</h4>
<p>Or moved?</p>



<a name="181121038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121038">(Nov 19 2019 at 15:21)</a>:</h4>
<p>I think "deinitialized" is good</p>



<a name="181121090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121090">(Nov 19 2019 at 15:22)</a>:</h4>
<p>"move" is the action</p>



<a name="181121094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121094">(Nov 19 2019 at 15:22)</a>:</h4>
<p>"deinitialized" is the state</p>



<a name="181121127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121127">(Nov 19 2019 at 15:22)</a>:</h4>
<p>That tracks, because I can imagine other types of deinitialisation perhaps maybe I don't know</p>



<a name="181121136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121136">(Nov 19 2019 at 15:22)</a>:</h4>
<p>right</p>



<a name="181121148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121148">(Nov 19 2019 at 15:22)</a>:</h4>
<p>In some future version of Rust</p>



<a name="181121178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121178">(Nov 19 2019 at 15:23)</a>:</h4>
<p>Or maybe if there's weirdness involved, like I don't know inline assembly or something</p>



<a name="181121222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121222">(Nov 19 2019 at 15:23)</a>:</h4>
<p>Matthew said there were edge cases with inline assembly that wouldn't work with what I'm doing</p>



<a name="181121262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121262">(Nov 19 2019 at 15:23)</a>:</h4>
<p>heh oh dear</p>



<a name="181121364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121364">(Nov 19 2019 at 15:24)</a>:</h4>
<p>ok well I'm just reading through the code and transcribing</p>



<a name="181121365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121365">(Nov 19 2019 at 15:24)</a>:</h4>
<p>so far so good</p>



<a name="181121375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121375">(Nov 19 2019 at 15:24)</a>:</h4>
<p>I've updated the names, hopefully consistently</p>



<a name="181121391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121391">(Nov 19 2019 at 15:24)</a>:</h4>
<p>me and <span class="user-mention" data-user-id="116113">@lqd</span> said yesterday that we'd probably try to go over the code at the end</p>



<a name="181121398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121398">(Nov 19 2019 at 15:24)</a>:</h4>
<p>to try and make it match the names in the hackmd</p>



<a name="181121427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121427">(Nov 19 2019 at 15:25)</a>:</h4>
<p>which introduces some "mapping confusion" for the time being but hopefully we can handle it</p>



<a name="181121433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121433">(Nov 19 2019 at 15:25)</a>:</h4>
<p>Hmm, this looks wrong though:</p>
<div class="codehilite"><pre><span></span><span class="nf">path_maybe_deinitialized_on_entry</span><span class="p">(</span><span class="nv">Path</span><span class="p">,</span> <span class="nv">Node</span><span class="p">)</span> <span class="p">:-</span>
    <span class="nf">path_moved_at</span><span class="p">(</span><span class="nv">Path</span><span class="p">,</span> <span class="nv">Node</span><span class="p">).</span>
</pre></div>



<a name="181121435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121435">(Nov 19 2019 at 15:25)</a>:</h4>
<p>should probably record the names from the code</p>



<a name="181121450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121450">(Nov 19 2019 at 15:25)</a>:</h4>
<p>yes, it does</p>



<a name="181121475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121475">(Nov 19 2019 at 15:25)</a>:</h4>
<p>I'm with deinitialized <em>on exit</em>, but not on entry</p>



<a name="181121485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121485">(Nov 19 2019 at 15:25)</a>:</h4>
<p>yes, though your comment suggests otherwise</p>



<a name="181121490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121490">(Nov 19 2019 at 15:25)</a>:</h4>
<p>score on for naming conventions</p>



<a name="181121539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121539">(Nov 19 2019 at 15:26)</a>:</h4>
<p>Yes, definitely</p>



<a name="181121547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121547">(Nov 19 2019 at 15:26)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="c1">// path_maybe_moved_at(Path, Point): There exists at least one path through</span>
<span class="w">    </span><span class="c1">// the CFG to Point such that `Path` has been moved out by the time we</span>
<span class="w">    </span><span class="c1">// arrive at `Point` without it being re-initialized for sure.</span>
</pre></div>



<a name="181121555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121555">(Nov 19 2019 at 15:26)</a>:</h4>
<p>Makes that much clearer and might have been a bug</p>



<a name="181121562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121562">(Nov 19 2019 at 15:26)</a>:</h4>
<p>"we arrive at"</p>



<a name="181121694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121694">(Nov 19 2019 at 15:27)</a>:</h4>
<p>The tell-tale sign is that it has the same shape as <code>initialized_on_exit</code>but not the same suffix :)</p>



<a name="181121724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121724">(Nov 19 2019 at 15:28)</a>:</h4>
<p>I'm trying to remember</p>



<a name="181121781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121781">(Nov 19 2019 at 15:28)</a>:</h4>
<p>is there a reason to distinguish "definitely initialized" from "maybe deinitialized"?</p>



<a name="181121789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121789">(Nov 19 2019 at 15:28)</a>:</h4>
<p>ah well I guess it's exactly</p>



<a name="181121795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121795">(Nov 19 2019 at 15:28)</a>:</h4>
<p>the fact that <em>un</em>initialized things are distinct?</p>



<a name="181121927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181121927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181121927">(Nov 19 2019 at 15:30)</a>:</h4>
<p>maybe deinitialized doesn't capture "never initialized"</p>



<a name="181122002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122002">(Nov 19 2019 at 15:30)</a>:</h4>
<p>right</p>



<a name="181122013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122013">(Nov 19 2019 at 15:30)</a>:</h4>
<p>in some versions of the compiler at least</p>



<a name="181122020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122020">(Nov 19 2019 at 15:30)</a>:</h4>
<p>we generated a "move" for a <code>let x</code> that does not initialize <code>x</code></p>



<a name="181122021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122021">(Nov 19 2019 at 15:30)</a>:</h4>
<p>but anyway</p>



<a name="181122027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122027">(Nov 19 2019 at 15:30)</a>:</h4>
<p>I'm definitely finding this naming convention helpful</p>



<a name="181122029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122029">(Nov 19 2019 at 15:30)</a>:</h4>
<p>e.g.</p>



<a name="181122036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122036">(Nov 19 2019 at 15:30)</a>:</h4>
<div class="codehilite"><pre><span></span>path_definitely_initialized_on_exit(Path, Node) :-
    path_maybe_initialized_on_exit(Path, Node),
    !path_maybe_deinitialized_on_exit(Path, Node).
</pre></div>



<a name="181122064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122064">(Nov 19 2019 at 15:31)</a>:</h4>
<p>vs <code>path_definitely_initialized_at</code></p>



<a name="181122071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122071">(Nov 19 2019 at 15:31)</a>:</h4>
<p>I would have guessed that the latter meant "on entry"</p>



<a name="181122074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122074">(Nov 19 2019 at 15:31)</a>:</h4>
<p>but it must be on exit...</p>



<a name="181122080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122080">(Nov 19 2019 at 15:31)</a>:</h4>
<p>Yes, it's much clearer</p>



<a name="181122104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122104">(Nov 19 2019 at 15:31)</a>:</h4>
<p>I feel like I need to draw this actually</p>



<a name="181122119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122119">(Nov 19 2019 at 15:31)</a>:</h4>
<p>I'm not.. entirely convinced this is true</p>



<a name="181122175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122175">(Nov 19 2019 at 15:32)</a>:</h4>
<p>e.g.</p>



<a name="181122177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122177">(Nov 19 2019 at 15:32)</a>:</h4>
<p>No, set subtraction is weird</p>



<a name="181122203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122203">(Nov 19 2019 at 15:32)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">a</span><span class="p">;</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="n">something</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">44</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="n">print</span><span class="p">(</span><span class="n">a</span><span class="p">);</span><span class="w"></span>
</pre></div>



<a name="181122216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122216">(Nov 19 2019 at 15:32)</a>:</h4>
<p>here <code>a</code> is "maybe initialized"</p>



<a name="181122223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122223">(Nov 19 2019 at 15:32)</a>:</h4>
<p>but it is not "maybe deinitialized"</p>



<a name="181122236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122236">(Nov 19 2019 at 15:32)</a>:</h4>
<p>hmmmm</p>



<a name="181122259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122259">(Nov 19 2019 at 15:33)</a>:</h4>
<p>Ok so maybe I didn't solve the problem I thought I solved</p>



<a name="181122419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122419">(Nov 19 2019 at 15:34)</a>:</h4>
<p>Or well, it did solve the problem I was trying to solve, which was just</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">a</span><span class="p">;</span><span class="w"></span>
<span class="n">print</span><span class="p">(</span><span class="n">a</span><span class="p">);</span><span class="w"></span>
</pre></div>



<a name="181122563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122563">(Nov 19 2019 at 15:35)</a>:</h4>
<p>it seems like we need <em>some</em> sort of action for "uninitialized variable"</p>



<a name="181122583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122583">(Nov 19 2019 at 15:35)</a>:</h4>
<p>Yes, I guess we do</p>



<a name="181122584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122584">(Nov 19 2019 at 15:35)</a>:</h4>
<p>e.g. maybe some facts that indicate the root</p>



<a name="181122630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122630">(Nov 19 2019 at 15:36)</a>:</h4>
<p>this could take many forms</p>



<a name="181122648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122648">(Nov 19 2019 at 15:36)</a>:</h4>
<p>well wait</p>



<a name="181122712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122712">(Nov 19 2019 at 15:37)</a>:</h4>
<p>er ok I guess that we can't readily do "intersection" of many flows</p>



<a name="181122769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122769">(Nov 19 2019 at 15:37)</a>:</h4>
<p>No, I ran into that problem many times trying to design this solution</p>



<a name="181122785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122785">(Nov 19 2019 at 15:37)</a>:</h4>
<p>I imagine this might take the form then of a <code>start_node</code> fact and perhaps <code>initialized_at(Path, Node)</code> facts for the parameters</p>



<a name="181122846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122846">(Nov 19 2019 at 15:38)</a>:</h4>
<blockquote>
<p>No, I ran into that problem many times trying to design this solution</p>
</blockquote>
<p>yes I think this is (well, partly) why we have traditionally propagated "moves"</p>



<a name="181122863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122863">(Nov 19 2019 at 15:38)</a>:</h4>
<p>(I think the other reason was that it's better for errors)</p>



<a name="181122914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122914">(Nov 19 2019 at 15:39)</a>:</h4>
<p>I'm not wild about <code>start_node</code> fact -- have to think -- well I guess it's ok. I'm just thinking about what to do for unreachable code blocks</p>



<a name="181122947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181122947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181122947">(Nov 19 2019 at 15:39)</a>:</h4>
<p>I don't honestly know what the current borrow checker does</p>



<a name="181123101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123101">(Nov 19 2019 at 15:40)</a>:</h4>
<p>(answer: you don't get errors from dead code (<a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=ce02613083bb8aafc9b46eeeb783cc04" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=ce02613083bb8aafc9b46eeeb783cc04">playground</a>))</p>



<a name="181123161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123161">(Nov 19 2019 at 15:41)</a>:</h4>
<p>that's what I thought, though I couldn't quite remember where we landed</p>



<a name="181123207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123207">(Nov 19 2019 at 15:41)</a>:</h4>
<blockquote>
<p>I imagine this might take the form then of a <code>start_node</code> fact and perhaps <code>initialized_at(Path, Node)</code> facts for the parameters</p>
</blockquote>
<p>actually I guess this doesn't work</p>



<a name="181123226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123226">(Nov 19 2019 at 15:41)</a>:</h4>
<p>you really need something to enumerate the set of "uninitialized" variables</p>



<a name="181123317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123317">(Nov 19 2019 at 15:42)</a>:</h4>
<p>Hm, yes I guess</p>



<a name="181123420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123420">(Nov 19 2019 at 15:43)</a>:</h4>
<p>I'm going quickly to check how borrow checker handles error reporting btw</p>



<a name="181123423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123423">(Nov 19 2019 at 15:43)</a>:</h4>
<p>The hard part is formulating this without saying something about all edges going into a node</p>



<a name="181123438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123438">(Nov 19 2019 at 15:43)</a>:</h4>
<p>Which we cannot capture</p>



<a name="181123443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123443">(Nov 19 2019 at 15:43)</a>:</h4>
<p>tracking "uninitialized" things seems easy enough</p>



<a name="181123463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123463">(Nov 19 2019 at 15:43)</a>:</h4>
<p>You mean, as in never initialised?</p>



<a name="181123473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123473">(Nov 19 2019 at 15:43)</a>:</h4>
<p>yeah</p>



<a name="181123538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123538">(Nov 19 2019 at 15:44)</a>:</h4>
<p>like if we had <code>local_variable(Var)</code> facts and <code>start_node(Node)</code></p>



<a name="181123574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123574">(Nov 19 2019 at 15:44)</a>:</h4>
<p>What would <code>local_variable</code> do?</p>



<a name="181123596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123596">(Nov 19 2019 at 15:44)</a>:</h4>
<p>you could do </p>
<div class="codehilite"><pre><span></span>path_maybe_uninitialized_on_exit(Path, Node) :-
    local_variable(Var),
    path_is_var(Path, Var),
    start_node(Node)
</pre></div>



<a name="181123639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123639">(Nov 19 2019 at 15:45)</a>:</h4>
<p>or alternatively the compiler could generate <code>path_moved_at</code> facts for all local variables at the start node</p>



<a name="181123665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123665">(Nov 19 2019 at 15:45)</a>:</h4>
<p>And <code>local_variable()</code> would essentially mean "not an argument"?</p>



<a name="181123680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123680">(Nov 19 2019 at 15:45)</a>:</h4>
<p>correct</p>



<a name="181123708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123708">(Nov 19 2019 at 15:45)</a>:</h4>
<p>we probably also want to record the arguments as initialzied -- but I guess we must already generate <code>path_initialized_at</code> facts for those</p>



<a name="181123711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123711">(Nov 19 2019 at 15:45)</a>:</h4>
<p>now that I think about it</p>



<a name="181123718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123718">(Nov 19 2019 at 15:46)</a>:</h4>
<p>or else we'd get errors all over the place</p>



<a name="181123765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123765">(Nov 19 2019 at 15:46)</a>:</h4>
<p>(seems worth noting)</p>



<a name="181123786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123786">(Nov 19 2019 at 15:46)</a>:</h4>
<p>Yes, I guess we must</p>



<a name="181123819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123819">(Nov 19 2019 at 15:46)</a>:</h4>
<p>Hmm, no I'm not sure come to think about it</p>



<a name="181123890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123890">(Nov 19 2019 at 15:47)</a>:</h4>
<p>No wait, that works, for some reason</p>



<a name="181123942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181123942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181123942">(Nov 19 2019 at 15:47)</a>:</h4>
<p>...yes because the arguments get initialized at the start of the block</p>



<a name="181124278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124278">(Nov 19 2019 at 15:50)</a>:</h4>
<p>ok, so, from skimming the code it appears to me that</p>



<a name="181124317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124317">(Nov 19 2019 at 15:50)</a>:</h4>
<p>the current borrow checker is also tracking "uninitialized paths"</p>



<a name="181124319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124319">(Nov 19 2019 at 15:50)</a>:</h4>
<p>which seems good</p>



<a name="181124331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124331">(Nov 19 2019 at 15:50)</a>:</h4>
<p>I know at some point we tracked instead "in-scope moves", in a sense</p>



<a name="181124352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124352">(Nov 19 2019 at 15:51)</a>:</h4>
<p>but I think we now compute those lazilly at the point of error instead</p>



<a name="181124394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124394">(Nov 19 2019 at 15:51)</a>:</h4>
<p>this suggests to me <span class="user-mention" data-user-id="204115">@Albin Stjerna</span> that the most consistent thing would be to add <code>path_moved_at</code> actions at the start block for local variables</p>



<a name="181124428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124428">(Nov 19 2019 at 15:51)</a>:</h4>
<p>(or some other name that winds up "unioned together")</p>



<a name="181124616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124616">(Nov 19 2019 at 15:53)</a>:</h4>
<blockquote>
<p>but I think we now compute those lazilly at the point of error instead</p>
</blockquote>
<p>specifically, in the <code>get_moved_indices</code> method, which I vaguely recall now</p>



<a name="181124883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124883">(Nov 19 2019 at 15:55)</a>:</h4>
<p>In that case, I thnk we can rename to <code>path_maybe_uninitialized_on_exit</code> and remove the "known initialized" computation altogether</p>



<a name="181124944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181124944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181124944">(Nov 19 2019 at 15:55)</a>:</h4>
<p>(which I have done in the doc, along with noting the assumption that <code>path_moved_at</code> includes tuples for all local variables at the start point)</p>



<a name="181125054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125054">(Nov 19 2019 at 15:56)</a>:</h4>
<p>Ok, sounds good!</p>



<a name="181125064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125064">(Nov 19 2019 at 15:56)</a>:</h4>
<p>I will note though that it should be possible to compute intersection too, as the cfg-edge is a fact</p>



<a name="181125081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125081">(Nov 19 2019 at 15:56)</a>:</h4>
<p>There are extensions to datalog that include cerain operators</p>



<a name="181125109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125109">(Nov 19 2019 at 15:57)</a>:</h4>
<p>If we wanted, one could imagine coding that up</p>



<a name="181125116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125116">(Nov 19 2019 at 15:57)</a>:</h4>
<p>But let's not go there for now</p>



<a name="181125128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125128">(Nov 19 2019 at 15:57)</a>:</h4>
<p>Nah</p>



<a name="181125164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125164">(Nov 19 2019 at 15:57)</a>:</h4>
<p>Ok good, then I can just fix that in my report as well and it will be...probably correct</p>



<a name="181125381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125381">(Nov 19 2019 at 15:59)</a>:</h4>
<p>lol</p>



<a name="181125409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125409">(Nov 19 2019 at 15:59)</a>:</h4>
<p>I'll have a look at emitting the facts in Rust</p>



<a name="181125426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125426">(Nov 19 2019 at 15:59)</a>:</h4>
<p>if I'm not mistaken</p>



<a name="181125433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125433">(Nov 19 2019 at 15:59)</a>:</h4>
<div class="codehilite"><pre><span></span>        // move_error(path, point) :-
        //     path_accessed_at(path, point),
        //     !path_definitely_initialized_at(path, point).
</pre></div>



<a name="181125437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125437">(Nov 19 2019 at 15:59)</a>:</h4>
<p>is wrong</p>



<a name="181125514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125514">(Nov 19 2019 at 16:00)</a>:</h4>
<p>precisely because of the on-entry vs on-exit confusion</p>



<a name="181125535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125535">(Nov 19 2019 at 16:00)</a>:</h4>
<p>a-ha!</p>



<a name="181125594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125594">(Nov 19 2019 at 16:01)</a>:</h4>
<div class="codehilite"><pre><span></span>move_error(Path, TargetNode) :-
    cfg_edge(SourceNode, TargetNode),
    path_accessed_at(Path, TargetNode),
    path_maybe_uninitialized_on_exit(SourceNode).
</pre></div>



<a name="181125598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125598">(Nov 19 2019 at 16:01)</a>:</h4>
<p>So the join we want is path_definitely_initialized_on_entry?</p>



<a name="181125613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125613">(Nov 19 2019 at 16:01)</a>:</h4>
<p>that seems more correct, right?</p>



<a name="181125687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125687">(Nov 19 2019 at 16:01)</a>:</h4>
<div class="codehilite"><pre><span></span>move_error(Path, TargetNode) :-
    path_maybe_uninitialized_on_exit(Path, SourceNode),
    cfg_edge(SourceNode, TargetNode),
    path_accessed_at(Path, TargetNode).
</pre></div>



<a name="181125696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125696">(Nov 19 2019 at 16:02)</a>:</h4>
<p>reordered and minor nits fixed</p>



<a name="181125753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125753">(Nov 19 2019 at 16:02)</a>:</h4>
<p>Hm yes that looks correct to me</p>



<a name="181125861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125861">(Nov 19 2019 at 16:03)</a>:</h4>
<p>The fact that this is no longer an antijoin might speed things up dramatically</p>



<a name="181125869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125869">(Nov 19 2019 at 16:03)</a>:</h4>
<p>ok, so the only remaining bit of confusion here</p>



<a name="181125879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125879">(Nov 19 2019 at 16:03)</a>:</h4>
<p>Also, eliminate most of the pipeline</p>



<a name="181125887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125887">(Nov 19 2019 at 16:03)</a>:</h4>
<p>is precisely what <code>var_maybe_initialized_on_exit</code> should be</p>



<a name="181125935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125935">(Nov 19 2019 at 16:03)</a>:</h4>
<p>I think it probably wants to be "any subpart of this variable is initialized"</p>



<a name="181125947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125947">(Nov 19 2019 at 16:04)</a>:</h4>
<p>however, I'm trying to remember just what we do in the existing borrow check</p>



<a name="181125991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125991">(Nov 19 2019 at 16:04)</a>:</h4>
<p>I know it's a bit.. more complex than that</p>



<a name="181125999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181125999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181125999">(Nov 19 2019 at 16:04)</a>:</h4>
<p>or maybe it's not</p>



<a name="181126027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181126027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181126027">(Nov 19 2019 at 16:04)</a>:</h4>
<p>(in particular, the role of this variable is to suppress drops where the value is dropped but not, in fact, initialized, right?)</p>



<a name="181126139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181126139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181126139">(Nov 19 2019 at 16:05)</a>:</h4>
<p>but let me start looking at liveness now, I guess</p>



<a name="181126228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181126228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181126228">(Nov 19 2019 at 16:06)</a>:</h4>
<blockquote>
<p>(in particular, the role of this variable is to suppress drops where the value is dropped but not, in fact, initialized, right?)</p>
</blockquote>
<p>It's only used when a variable implements its own deallocator</p>



<a name="181126364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181126364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181126364">(Nov 19 2019 at 16:07)</a>:</h4>
<p>We use it when a drop of a variable may happen, and that variable overrides drop() in order to force any origin inside of that variable (which may be a compex struct) to be live</p>



<a name="181126365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181126365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181126365">(Nov 19 2019 at 16:07)</a>:</h4>
<p>That's all</p>



<a name="181127185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127185">(Nov 19 2019 at 16:14)</a>:</h4>
<p>Yeah, I think that the more complex part comes when computing the <code>invalidates</code> facts</p>



<a name="181127200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127200">(Nov 19 2019 at 16:14)</a>:</h4>
<p>ps, that would be better renamed to <code>loan_invalidated_at</code>...</p>



<a name="181127503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127503">(Nov 19 2019 at 16:16)</a>:</h4>
<p>OK, <strong>bikeshed time</strong></p>



<a name="181127519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127519">(Nov 19 2019 at 16:17)</a>:</h4>
<div class="codehilite"><pre><span></span>var_uses_origin
</pre></div>



<a name="181127524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127524">(Nov 19 2019 at 16:17)</a>:</h4>
<p>or</p>



<a name="181127535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127535">(Nov 19 2019 at 16:17)</a>:</h4>
<div class="codehilite"><pre><span></span>var_uses_data_with_origin
</pre></div>



<a name="181127540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127540">(Nov 19 2019 at 16:17)</a>:</h4>
<p>or something like that</p>



<a name="181127550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127550">(Nov 19 2019 at 16:17)</a>:</h4>
<p>the latter is probably too long</p>



<a name="181127571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127571">(Nov 19 2019 at 16:17)</a>:</h4>
<p>It's a bit long yes</p>



<a name="181127635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127635">(Nov 19 2019 at 16:18)</a>:</h4>
<p>(note that the term provenance doesn't (I don't think) read any better  here)</p>



<a name="181127693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127693">(Nov 19 2019 at 16:18)</a>:</h4>
<p>No, and I don't like "uses" either</p>



<a name="181127709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127709">(Nov 19 2019 at 16:18)</a>:</h4>
<p>It's too abstract; what is happening here is...more concrete than that</p>



<a name="181127766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127766">(Nov 19 2019 at 16:19)</a>:</h4>
<p><code>var_may_come_from_origin</code>?</p>



<a name="181127830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127830">(Nov 19 2019 at 16:19)</a>:</h4>
<p><code>var_may_refer_to_origin</code>?</p>



<a name="181127935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127935">(Nov 19 2019 at 16:20)</a>:</h4>
<p><code>var_refers_to_origin</code> is ok</p>



<a name="181127966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181127966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181127966">(Nov 19 2019 at 16:20)</a>:</h4>
<p>but what about <code>var_drops_origin</code></p>



<a name="181128152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128152">(Nov 19 2019 at 16:22)</a>:</h4>
<p>Yes that's very opaque</p>



<a name="181128167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128167">(Nov 19 2019 at 16:22)</a>:</h4>
<p>Also, the relation is really indirect</p>



<a name="181128199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128199">(Nov 19 2019 at 16:22)</a>:</h4>
<p>the origin is...used in a drop of var</p>



<a name="181128452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128452">(Nov 19 2019 at 16:25)</a>:</h4>
<p>Haha, I just found this code, which I apparently wrote:</p>
<div class="codehilite"><pre><span></span><span class="c1">// Arguments are initialized on function entry</span>
<span class="w">            </span><span class="n">InitLocation</span>::<span class="n">Argument</span><span class="p">(</span><span class="n">local</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="n">assert</span><span class="o">!</span><span class="p">(</span><span class="n">body</span><span class="p">.</span><span class="n">local_kind</span><span class="p">(</span><span class="n">local</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">LocalKind</span>::<span class="n">Arg</span><span class="p">);</span><span class="w"></span>
<span class="w">                </span><span class="kd">let</span><span class="w"> </span><span class="n">fn_entry</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Location</span><span class="w"> </span><span class="p">{</span><span class="n">block</span>: <span class="nc">BasicBlock</span>::<span class="n">from_u32</span><span class="p">(</span><span class="mi">0</span><span class="k">u32</span><span class="p">),</span><span class="w"> </span><span class="n">statement_index</span>: <span class="mi">0</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="w">                </span><span class="n">all_facts</span><span class="p">.</span><span class="n">initialized_at</span><span class="p">.</span><span class="n">push</span><span class="p">((</span><span class="n">init</span><span class="p">.</span><span class="n">path</span><span class="p">,</span><span class="w"> </span><span class="n">location_table</span><span class="p">.</span><span class="n">start_index</span><span class="p">(</span><span class="n">fn_entry</span><span class="p">)));</span><span class="w"></span>

<span class="w">            </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="181128488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128488">(Nov 19 2019 at 16:25)</a>:</h4>
<p>So ok, that was me</p>



<a name="181128510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128510">(Nov 19 2019 at 16:25)</a>:</h4>
<p>I like my descritpion</p>



<a name="181128531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128531">(Nov 19 2019 at 16:26)</a>:</h4>
<div class="codehilite"><pre><span></span>// References with the given origin may be
// dereferenced when the variable is used
.decl var_uses_origin(Variable, Origin)

// References with the given origin may be
// dereferenced when the variable is dropped
.decl var_drops_origin(Variable, Origin)
</pre></div>



<a name="181128587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128587">(Nov 19 2019 at 16:26)</a>:</h4>
<p>but I don't know how to turn those comments into concise relation names :)</p>



<a name="181128611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128611">(Nov 19 2019 at 16:26)</a>:</h4>
<p>use_of_var_derefs_origin(Var, Origin)</p>



<a name="181128624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128624">(Nov 19 2019 at 16:26)</a>:</h4>
<p>drop_of_var_derefs_origin(Var, Origin)</p>



<a name="181128625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128625">(Nov 19 2019 at 16:26)</a>:</h4>
<p>maybe?</p>



<a name="181128893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181128893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181128893">(Nov 19 2019 at 16:29)</a>:</h4>
<p>var_use_derefs_origin / var_drop_derefs_origin ?</p>



<a name="181129057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129057">(Nov 19 2019 at 16:30)</a>:</h4>
<p>also plausible</p>



<a name="181129107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129107">(Nov 19 2019 at 16:31)</a>:</h4>
<p>ps <span class="user-mention" data-user-id="204115">@Albin Stjerna</span> I am pretty sure that we want to compute (what I am calling) <code>var_maybe_partly_initialized_on_exit</code> -- i.e., it's true if any sub-path of the variable is initialized.</p>



<a name="181129120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129120">(Nov 19 2019 at 16:31)</a>:</h4>
<p>I'll have to check the code but I feel like that must be what it is using</p>



<a name="181129133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129133">(Nov 19 2019 at 16:31)</a>:</h4>
<p>Hmm, that's what I was computing before</p>



<a name="181129148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129148">(Nov 19 2019 at 16:31)</a>:</h4>
<p>(that said, I could imagine us trying to make this more precise in the future)</p>



<a name="181129167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129167">(Nov 19 2019 at 16:31)</a>:</h4>
<p>e.g. if you have</p>



<a name="181129169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129169">(Nov 19 2019 at 16:31)</a>:</h4>
<p>I think I got the same liveness output if I made it simpler</p>



<a name="181129235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129235">(Nov 19 2019 at 16:32)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">vec</span><span class="o">!</span><span class="p">[],</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[]);</span><span class="w"></span>
<span class="n">drop</span><span class="p">(</span><span class="n">x</span><span class="p">.</span><span class="mi">1</span><span class="p">);</span><span class="w"></span>
</pre></div>



<a name="181129248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129248">(Nov 19 2019 at 16:32)</a>:</h4>
<p>the drop of <code>x</code> is still going to drop <code>x.0</code>, and is hence still relevant</p>



<a name="181129251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129251">(Nov 19 2019 at 16:32)</a>:</h4>
<p>(working on initial moves for non-arguments)</p>



<a name="181129273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129273">(Nov 19 2019 at 16:32)</a>:</h4>
<p>ok, well, we should work this out</p>



<a name="181129326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129326">(Nov 19 2019 at 16:33)</a>:</h4>
<p>Yes, we should</p>



<a name="181129353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129353">(Nov 19 2019 at 16:33)</a>:</h4>
<p>The question I guess becomes what MIR that will translate to</p>



<a name="181129496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129496">(Nov 19 2019 at 16:34)</a>:</h4>
<p>the MIR will have a drop of X in that case</p>



<a name="181129506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129506">(Nov 19 2019 at 16:34)</a>:</h4>
<p>there is a later pass that converts it to <code>drop(x.0)</code>, but it hasn't executed yet</p>



<a name="181129516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129516">(Nov 19 2019 at 16:34)</a>:</h4>
<p>I will check the code in a bit</p>



<a name="181129525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129525">(Nov 19 2019 at 16:34)</a>:</h4>
<p>I'm still going over the liveness rules</p>



<a name="181129555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129555">(Nov 19 2019 at 16:35)</a>:</h4>
<p>I think what would happen is that the MIR would have an extraction of x.1 into a variable, and then drop that variable</p>



<a name="181129581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129581">(Nov 19 2019 at 16:35)</a>:</h4>
<p>And then that variable would be initialized</p>



<a name="181129592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129592">(Nov 19 2019 at 16:35)</a>:</h4>
<p>according to Polonius</p>



<a name="181129667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129667">(Nov 19 2019 at 16:36)</a>:</h4>
<p>I gotta find some place to drop other notes</p>



<a name="181129672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129672">(Nov 19 2019 at 16:36)</a>:</h4>
<p>e.g., there is an efficiency thing</p>



<a name="181129700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129700">(Nov 19 2019 at 16:36)</a>:</h4>
<p>in particular in the borrow checker, we stop computing "drop-use" ranges when we see that something is "use live"</p>



<a name="181129712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129712">(Nov 19 2019 at 16:37)</a>:</h4>
<p>because we know that a full use always uses all the origins that a drop-use would use</p>



<a name="181129738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129738">(Nov 19 2019 at 16:37)</a>:</h4>
<p>That's smart</p>



<a name="181129745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129745">(Nov 19 2019 at 16:37)</a>:</h4>
<p>this might dramatically reduce the number of tuples</p>



<a name="181129753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129753">(Nov 19 2019 at 16:37)</a>:</h4>
<p>in certain cases, at least</p>



<a name="181129765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129765">(Nov 19 2019 at 16:37)</a>:</h4>
<p>well... up to 2x I guess :)</p>



<a name="181129769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129769">(Nov 19 2019 at 16:37)</a>:</h4>
<p>Drop-liveness is incredibly uncommon</p>



<a name="181129795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129795">(Nov 19 2019 at 16:38)</a>:</h4>
<p>Remember, I think we only compute this for structs that implement <code>drop()</code></p>



<a name="181129862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129862">(Nov 19 2019 at 16:38)</a>:</h4>
<p>Maybe not all the precursors perhaps</p>



<a name="181129882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129882">(Nov 19 2019 at 16:38)</a>:</h4>
<p>Yes, I know</p>



<a name="181129889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129889">(Nov 19 2019 at 16:38)</a>:</h4>
<p>It's ok as is for now</p>



<a name="181129901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181129901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181129901">(Nov 19 2019 at 16:38)</a>:</h4>
<p>I noted it as an "opt opportunity"</p>



<a name="181130004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181130004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181130004">(Nov 19 2019 at 16:40)</a>:</h4>
<blockquote>
<p>var_use_derefs_origin / var_drop_derefs_origin ?</p>
</blockquote>
<p>I think this one is probably best from our bikeshed? or else <code>use_of_var...</code></p>



<a name="181130088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181130088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181130088">(Nov 19 2019 at 16:40)</a>:</h4>
<p>Yes, I agree!</p>



<a name="181130094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181130094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181130094">(Nov 19 2019 at 16:40)</a>:</h4>
<p>I personally find the <code>use_of_var_derefs_origin</code> a bit clearer, if verbose</p>



<a name="181130108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181130108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181130108">(Nov 19 2019 at 16:40)</a>:</h4>
<p>mostly because my brain keeps trying to read "use" as a verb</p>



<a name="181130109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181130109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181130109">(Nov 19 2019 at 16:40)</a>:</h4>
<p>and not a noun</p>



<a name="181130126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181130126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181130126">(Nov 19 2019 at 16:41)</a>:</h4>
<p>but I would go with whichever</p>



<a name="181130581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181130581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181130581">(Nov 19 2019 at 16:46)</a>:</h4>
<p>Me too</p>



<a name="181130585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181130585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181130585">(Nov 19 2019 at 16:46)</a>:</h4>
<p>I don't have a strong preference either way</p>



<a name="181130605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181130605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181130605">(Nov 19 2019 at 16:46)</a>:</h4>
<p>I'm going to head home soon by the way, and have dinner</p>



<a name="181131689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131689">(Nov 19 2019 at 16:59)</a>:</h4>
<p>It seems the test cases I wrote all work, and so does Niko's, when I add moves at the start of the function!</p>



<a name="181131719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131719">(Nov 19 2019 at 16:59)</a>:</h4>
<p>woohoo</p>



<a name="181131732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131732">(Nov 19 2019 at 16:59)</a>:</h4>
<p>not sure if you saw but I've basically finished writing up the rules in hackmd</p>



<a name="181131737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131737">(Nov 19 2019 at 16:59)</a>:</h4>
<p>they diverge slightly from your branch in the ways we discussed</p>



<a name="181131821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131821">(Nov 19 2019 at 17:00)</a>:</h4>
<p>That's good; I'll fix the branch to follow your suggestions</p>



<a name="181131833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131833">(Nov 19 2019 at 17:00)</a>:</h4>
<p>I ... think they are correct :)</p>



<a name="181131842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131842">(Nov 19 2019 at 17:00)</a>:</h4>
<p>let me know if you see any discrepancies</p>



<a name="181131903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131903">(Nov 19 2019 at 17:01)</a>:</h4>
<p>(sorry I wasn't able to follow much (if any) of what was going on :/ but I see you two have made a lot of concrete progress on naming, rules, reviewing most of the pipeline, etc thank you <span class="user-mention" data-user-id="204115">@Albin Stjerna</span> and <span class="user-mention" data-user-id="116009">@nikomatsakis</span> for your time y'all are awesome)</p>



<a name="181131911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131911">(Nov 19 2019 at 17:01)</a>:</h4>
<p>My gut feeling says the rules you have will run significantly faster than the ones I had before</p>



<a name="181131993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131993">(Nov 19 2019 at 17:02)</a>:</h4>
<p>They seem to require less fighting with Datafrog</p>



<a name="181131997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181131997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181131997">(Nov 19 2019 at 17:02)</a>:</h4>
<p>when we're all done with this, we need to write up a "sprint report" for Inside Rust blog</p>



<a name="181132205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181132205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181132205">(Nov 19 2019 at 17:05)</a>:</h4>
<p>Note that one of the todos in my PR is precisely verifying what you were arguing against, <span class="user-mention" data-user-id="116009">@nikomatsakis</span>, that is that we can get away with not computing partial initialization for drop-liveness :)</p>



<a name="181132268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181132268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181132268">(Nov 19 2019 at 17:05)</a>:</h4>
<p>I'm still not convinced</p>



<a name="181132270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181132270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181132270">(Nov 19 2019 at 17:05)</a>:</h4>
<p>I should come up with a good test</p>



<a name="181165158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181165158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181165158">(Nov 19 2019 at 23:24)</a>:</h4>
<p>the new renaming, analyses descriptions, etc, in the hackmd, are super cool, great job</p>



<a name="181186550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181186550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181186550">(Nov 20 2019 at 08:01)</a>:</h4>
<p>My plan is to add them to the book in my PR as well</p>



<a name="181229699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181229699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181229699">(Nov 20 2019 at 17:29)</a>:</h4>
<p>Ok, I have spent most of the day implementing most of the rules Niko described, including renamings</p>



<a name="181229724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181229724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181229724">(Nov 20 2019 at 17:29)</a>:</h4>
<p>of...virtually all liveness-and-initialization-touching facts</p>



<a name="181229768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181229768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181229768">(Nov 20 2019 at 17:30)</a>:</h4>
<p>Which I just finished, coming soon in the PR I hope</p>



<a name="181231864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181231864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181231864">(Nov 20 2019 at 17:52)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> nice &lt;3</p>



<a name="181235425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181235425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181235425">(Nov 20 2019 at 18:32)</a>:</h4>
<p>You say NOW, wait until you see the diff</p>



<a name="181235439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181235439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181235439">(Nov 20 2019 at 18:32)</a>:</h4>
<p>Just imagine the fact regeneration mess</p>



<a name="181236920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181236920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181236920">(Nov 20 2019 at 18:53)</a>:</h4>
<p>The PR is now completely unreadable</p>



<a name="181237595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181237595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181237595">(Nov 20 2019 at 19:00)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> If it turns out you can convince me that we need to worry about partial initialization for drops, I propose that we just join path_is_var through ancestor and use that rather than extra facts.</p>



<a name="181285012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181285012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181285012">(Nov 21 2019 at 08:34)</a>:</h4>
<p>I gave up already and implemented that :)</p>



<a name="181285026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181285026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181285026">(Nov 21 2019 at 08:34)</a>:</h4>
<p>This means that the initialization thing just needs a book entry</p>



<a name="181285030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181285030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181285030">(Nov 21 2019 at 08:34)</a>:</h4>
<p>And then it's ready for reveiw</p>



<a name="181285074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181285074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181285074">(Nov 21 2019 at 08:35)</a>:</h4>
<p>It made the initialization pipeline super clean</p>



<a name="181285120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181285120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181285120">(Nov 21 2019 at 08:36)</a>:</h4>
<p>Because now there's two steps where the first one consumes all inputs and elaborates, and the other one starts from the first one's conclusions</p>



<a name="181603739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603739">(Nov 22 2019 at 01:49)</a>:</h4>
<blockquote>
<p>I gave up already and implemented that :)</p>
</blockquote>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> so I thought about the question of whether you need to track partial initialization. I think the example I was imagining was one like this:</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">y</span><span class="p">;</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">vec</span><span class="o">!</span><span class="p">[</span><span class="o">&amp;</span><span class="n">x</span><span class="p">],</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[</span><span class="o">&amp;</span><span class="n">y</span><span class="p">]);</span><span class="w"></span>
<span class="n">drop</span><span class="p">(</span><span class="n">v</span><span class="p">.</span><span class="mi">1</span><span class="p">);</span><span class="w"></span>
<span class="c1">// here, because `v` will be dropped, I think both x and y are *both* considered borrowed still</span>
</pre></div>


<p>OK, actually, that example doesn't error -- but that's because we know that <code>Vec</code> doesn't refernce its data. <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=6ac253efc262ae2526c528519d411177" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=6ac253efc262ae2526c528519d411177">This version does error</a>, when we use a random type with a dtor.</p>



<a name="181603742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603742">(Nov 22 2019 at 01:49)</a>:</h4>
<p>I realized as I was writing it up though that the way the rules are written, I think</p>



<a name="181603789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603789">(Nov 22 2019 at 01:50)</a>:</h4>
<p>you will have here 2 initialized paths -- <code>v</code> and <code>v.0</code> -- and one uninitialized path -- <code>v.1</code></p>



<a name="181603794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603794">(Nov 22 2019 at 01:50)</a>:</h4>
<p>it may well therefore be true that we only need to consider the  local variable path<code>v</code></p>



<a name="181603796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603796">(Nov 22 2019 at 01:50)</a>:</h4>
<p>however</p>



<a name="181603802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603802">(Nov 22 2019 at 01:50)</a>:</h4>
<p>well it still feels "more right" to me to consider all the paths :)</p>



<a name="181603812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603812">(Nov 22 2019 at 01:51)</a>:</h4>
<p>but I guess the point is that <code>initialized_on_entry(Path, Point)</code> (or whatever we called it) really means that the path is (at least) <strong>partially initialized</strong> on entry</p>



<a name="181603821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603821">(Nov 22 2019 at 01:51)</a>:</h4>
<p>and, at least sometimes, we will have subpaths -- so for it to be fully initialized, all subpaths must also be present</p>



<a name="181603826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603826">(Nov 22 2019 at 01:51)</a>:</h4>
<p>sorry if this is a conversation we already had</p>



<a name="181603870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603870">(Nov 22 2019 at 01:52)</a>:</h4>
<p>I guess I would say, with that understanding, and if we document the relation in that way, I am comfortable with the version that just checks for the path that is <em>equal</em> to the variable -- but I also think they are both equivalent</p>



<a name="181603874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181603874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181603874">(Nov 22 2019 at 01:52)</a>:</h4>
<p>anyway so what branches here are ready for merge :)</p>



<a name="181624995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181624995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181624995">(Nov 22 2019 at 10:18)</a>:</h4>
<p>We could merge my PR I think, and I could send a later PR documenting it in the book</p>



<a name="181625028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181625028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181625028">(Nov 22 2019 at 10:19)</a>:</h4>
<p>"My PR" = <a href="https://github.com/rust-lang-nursery/polonius/issues/135" target="_blank" title="https://github.com/rust-lang-nursery/polonius/issues/135">polonius#135</a></p>



<a name="181625265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181625265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181625265">(Nov 22 2019 at 10:22)</a>:</h4>
<p>I don't know why cargo fmt errors on CI; <em>my</em> cargo fmt doesn't suggest any changes???</p>



<a name="181627172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181627172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181627172">(Nov 22 2019 at 10:50)</a>:</h4>
<p>a couple notes, 1) I think you don't need to into_iter/iter.collect, you could extend(x.iter()) (or sometimes it's also possible to just move the relation from your context into the variables) 2) Vec::new isn't an expensive operation, so no real need to avoid one creation with the <code>or_insert_with(Vec::new)</code>, that being said, it's probably easier/best to use <code>or_default</code> instead</p>



<a name="181637373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181637373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181637373">(Nov 22 2019 at 13:33)</a>:</h4>
<p>3) how much of these new/updated .facts datasets do we need ? I think a lot of those were added as unit tests back in the first liveness PRs, but then were removed from the tests, but the <code>./inputs/</code> datasets were kept IIRC. They might have already served their purpose, or are you often rerunning polonius with all these liveness and initialization datasets ? if they're less useful now than they were before, maybe we can delete the ones we don't re-run often and are not automatically checked by the unit tests, what do you think ?</p>



<a name="181958469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958469">(Nov 26 2019 at 20:07)</a>:</h4>
<blockquote>
<p>a couple notes, 1) I think you don't need to into_iter/iter.collect, you could extend(x.iter()) (or sometimes it's also possible to just move the relation from your context into the variables) 2) Vec::new isn't an expensive operation, so no real need to avoid one creation with the <code>or_insert_with(Vec::new)</code>, that being said, it's probably easier/best to use <code>or_default</code> instead</p>
</blockquote>
<p>Thanks! I did that because it was suggested by Clippy, I could of course change that back :)</p>



<a name="181958556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958556">(Nov 26 2019 at 20:08)</a>:</h4>
<blockquote>
<p>3) how much of these new/updated .facts datasets do we need ? I think a lot of those were added as unit tests back in the first liveness PRs, but then were removed from the tests, but the <code>./inputs/</code> datasets were kept IIRC. They might have already served their purpose, or are you often rerunning polonius with all these liveness and initialization datasets ? if they're less useful now than they were before, maybe we can delete the ones we don't re-run often and are not automatically checked by the unit tests, what do you think ?</p>
</blockquote>
<p>Very few of them, and I think it makes sense to aim for using polonius-parser etc instead</p>



<a name="181958638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958638">(Nov 26 2019 at 20:09)</a>:</h4>
<p>ok then we can clean this up later, after move errors land</p>



<a name="181958746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958746">(Nov 26 2019 at 20:10)</a>:</h4>
<p>Sounds good! I'd like to write something in the book and look at extending the parser as well, but I'm not sure how much time I have this week</p>



<a name="181958801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958801">(Nov 26 2019 at 20:11)</a>:</h4>
<p>I've been procrastinating the actual research I'm supposed to do a bit too much :(</p>



<a name="181958804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958804">(Nov 26 2019 at 20:11)</a>:</h4>
<p>I was about to ask/look for what you'd need in the parser ?</p>



<a name="181958816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958816">(Nov 26 2019 at 20:11)</a>:</h4>
<p>Basically none of the facts I added exist there yet</p>



<a name="181958820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958820">(Nov 26 2019 at 20:11)</a>:</h4>
<p>And I'm not sure how to handle variables in general, to be honest</p>



<a name="181958872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958872">(Nov 26 2019 at 20:12)</a>:</h4>
<p>Because explicitly declaring both path parent/child relations and variables seems a bit redundant</p>



<a name="181958888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958888">(Nov 26 2019 at 20:12)</a>:</h4>
<p>indeed</p>



<a name="181958908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181958908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181958908">(Nov 26 2019 at 20:13)</a>:</h4>
<p>the liveness facts would need to be added as well, right ? not just the initialization ones ?</p>



<a name="181959141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959141">(Nov 26 2019 at 20:15)</a>:</h4>
<p>ah no, some are already there</p>



<a name="181959413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959413">(Nov 26 2019 at 20:17)</a>:</h4>
<p>Yes, but I think they are incomplete</p>



<a name="181959417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959417">(Nov 26 2019 at 20:17)</a>:</h4>
<p>I'd have to do an inventory :)</p>



<a name="181959479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959479">(Nov 26 2019 at 20:18)</a>:</h4>
<p>But I think I know enough to write the rules without any greater problems</p>



<a name="181959515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959515">(Nov 26 2019 at 20:18)</a>:</h4>
<p>I just don't have time right now</p>



<a name="181959610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959610">(Nov 26 2019 at 20:19)</a>:</h4>
<p>to write the initialization/move errors rules you mean ?</p>



<a name="181959633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959633">(Nov 26 2019 at 20:19)</a>:</h4>
<p>or something related to the parser and unit tests</p>



<a name="181959718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959718">(Nov 26 2019 at 20:20)</a>:</h4>
<p>Both :)</p>



<a name="181959724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959724">(Nov 26 2019 at 20:20)</a>:</h4>
<p>But yes, the parser, and the unit tests</p>



<a name="181959741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959741">(Nov 26 2019 at 20:21)</a>:</h4>
<p>As in "the last bits of work to do on initialisation"</p>



<a name="181959812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959812">(Nov 26 2019 at 20:21)</a>:</h4>
<p>if you already have in mind how they're supposed to work, and have the time to leave a couple notes somewhere, I can look at it if it would help</p>



<a name="181959937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959937">(Nov 26 2019 at 20:23)</a>:</h4>
<p>Sure! I'll see if I can describe it in the PR sometime tomorrow</p>



<a name="181959950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959950">(Nov 26 2019 at 20:23)</a>:</h4>
<p>No wait, no time like the present</p>



<a name="181959985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181959985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181959985">(Nov 26 2019 at 20:23)</a>:</h4>
<p>alright :)</p>



<a name="181960090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181960090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181960090">(Nov 26 2019 at 20:25)</a>:</h4>
<p>I'll have a little unexpected time since what I was planning on doing apparently needs to wait for niko to be back, so I can look at this parser thing for the initialization facts earlier than I thought</p>



<a name="181961554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181961554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181961554">(Nov 26 2019 at 20:43)</a>:</h4>
<p>Ah!</p>



<a name="181961561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181961561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181961561">(Nov 26 2019 at 20:43)</a>:</h4>
<p>Ok, it's here: <a href="https://github.com/rust-lang/polonius/pull/135#issuecomment-558809090" target="_blank" title="https://github.com/rust-lang/polonius/pull/135#issuecomment-558809090">https://github.com/rust-lang/polonius/pull/135#issuecomment-558809090</a></p>



<a name="181961568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181961568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181961568">(Nov 26 2019 at 20:43)</a>:</h4>
<p>I wrote some discussion of what I think should be done as well</p>



<a name="181961825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181961825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181961825">(Nov 26 2019 at 20:44)</a>:</h4>
<p>Because I'm not clear how "bare bones" the input should be, and I think it makes a lot of sense to do some abstracting</p>



<a name="181962328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181962328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181962328">(Nov 26 2019 at 20:49)</a>:</h4>
<p>sweet, thank you :)</p>



<a name="181963458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181963458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181963458">(Nov 26 2019 at 21:01)</a>:</h4>
<p>Hey, you're the one who just volunteered to do my work for me <span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span>️</p>



<a name="181967917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/initialization/near/181967917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/initialization.html#181967917">(Nov 26 2019 at 21:55)</a>:</h4>
<p>ofc whatever we do here will be less validating than rustc's tests, so integrating init/move errors  will be the most important :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>